From 1c8a5757b9a7c3c694ed3c1c43f7c60a1e4ce84d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 17 Jun 2015 22:46:07 +0200 Subject: [PATCH] Possibly fix a sound issue related to JSON diffs. --- www/js/remoteglot.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index d34b4d6..d666342 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -137,12 +137,14 @@ var request_update = function() { sync_server_clock(xhr.getResponseHeader('Date')); ims = xhr.getResponseHeader('X-RGLM'); var num_viewers = xhr.getResponseHeader('X-RGNV'); - possibly_play_sound(current_analysis_data, data); + var new_data; if (Array.isArray(data)) { - current_analysis_data = JSON_delta.patch(current_analysis_data, data); + new_data = JSON_delta.patch(current_analysis_data, data); } else { - current_analysis_data = data; + new_data = data; } + possibly_play_sound(current_analysis_data, new_data); + current_analysis_data = new_data; update_board(current_analysis_data, displayed_analysis_data); update_num_viewers(num_viewers); -- 2.39.2