From 9d0e1a2e0cb4cd9891e422cbae760f4b78269437 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 23 Oct 2017 22:43:00 -0700 Subject: [PATCH] subs: Don't try to update stream settings UI when closed. The recent fixes we made to make stream settings update properly when doing live updates were great, but they would throw an exception if the stream settings overlay wasn't open. This fixes that by adding the appropriate check. --- static/js/stream_events.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/stream_events.js b/static/js/stream_events.js index 611d8f295d..5194888761 100644 --- a/static/js/stream_events.js +++ b/static/js/stream_events.js @@ -106,8 +106,8 @@ exports.mark_subscribed = function (sub, subscribers, color) { stream_data.set_subscribers(sub, subscribers); } - subs.update_settings_for_subscribed(sub); if (overlays.streams_open()) { + subs.update_settings_for_subscribed(sub); subs.actually_filter_streams(); } @@ -129,8 +129,9 @@ exports.mark_unsubscribed = function (sub) { } else if (sub.subscribed) { stream_data.unsubscribe_myself(sub); - subs.update_settings_for_unsubscribed(sub); - + if (overlays.streams_open()) { + subs.update_settings_for_unsubscribed(sub); + } } else { // Already unsubscribed return;