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.
This commit is contained in:
Hemant Umre 2023-02-01 20:39:07 +05:30 committed by Tim Abbott
parent 95abcffb75
commit 2e2b4f5325
1 changed files with 1 additions and 1 deletions

View File

@ -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");