From a47d204ca02f555726d045743e35c63d6328bcbb Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Tue, 30 May 2023 20:34:49 +0000 Subject: [PATCH] stream_ui_updates: Only update UI if the stream is being edited. If the stream settings is open but the stream which was subscribed/unsubscribed wasn't open (say user unsubscribed from a different tab), `$settings_button` would be `undefined` here. --- web/src/stream_ui_updates.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/stream_ui_updates.js b/web/src/stream_ui_updates.js index 1859fef2c5..82756b4d8b 100644 --- a/web/src/stream_ui_updates.js +++ b/web/src/stream_ui_updates.js @@ -70,6 +70,10 @@ export function enable_or_disable_subscribers_tab(sub) { } export function update_settings_button_for_sub(sub) { + if (!hash_util.is_editing_stream(sub.stream_id)) { + return; + } + // This is for the Subscribe/Unsubscribe button in the right panel. const $settings_button = stream_settings_ui.settings_button_for_sub(sub); if (sub.subscribed) {