From 2e2b4f5325e9d1376824bffb0a902249560987f7 Mon Sep 17 00:00:00 2001 From: Hemant Umre Date: Wed, 1 Feb 2023 20:39:07 +0530 Subject: [PATCH] stream_settings: Fix Announce stream disables unexpectedly. While switching from a private stream in the stream editing UI to the stream creation UI, Announce stream becomes disabled. The state of Announce stream option should not be affected by where the create stream UI is opened. Made the privacy_type selector more specific since it was also selecting the last opened stream privacy type. Fixes: #24238. --- static/js/stream_create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/stream_create.js b/static/js/stream_create.js index 313c84337f..cdb51e0862 100644 --- a/static/js/stream_create.js +++ b/static/js/stream_create.js @@ -133,7 +133,7 @@ function update_announce_stream_state() { const $announce_stream_checkbox = $("#announce-new-stream input"); const $announce_stream_label = $("#announce-new-stream"); let disable_it = false; - const privacy_type = $("input:radio[name=privacy]:checked").val(); + const privacy_type = $("#stream_creation_form input:radio[name=privacy]:checked").val(); const is_invite_only = privacy_type === "invite-only" || privacy_type === "invite-only-public-history"; $announce_stream_label.removeClass("control-label-disabled");