mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
stream settings: Warn users before locking them out of a stream.
Organization owners can make streams private even if they're not subscribed to them, but cannot access private streams they're not subscribed to. This means they're able to lock themself out of streams. This change warns users of this and give them a chance to subscribe. Fixes #26437.
This commit is contained in:
@@ -466,6 +466,36 @@ export function initialize() {
|
||||
return true;
|
||||
});
|
||||
|
||||
$("#streams_overlay_container").on(
|
||||
"click",
|
||||
".stream-permissions-warning-banner .main-view-banner-close-button",
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
$("#stream_permission_settings .stream-permissions-warning-banner").empty();
|
||||
},
|
||||
);
|
||||
|
||||
$("#streams_overlay_container").on(
|
||||
"click",
|
||||
".stream-permissions-warning-banner .main-view-banner-action-button",
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const $target = $(event.target).parents(".main-view-banner");
|
||||
const stream_id = Number.parseInt($target.attr("data-stream-id"), 10);
|
||||
// Makes sure we take the correct stream_row.
|
||||
const $stream_row = $(
|
||||
`#streams_overlay_container div.stream-row[data-stream-id='${CSS.escape(
|
||||
stream_id,
|
||||
)}']`,
|
||||
);
|
||||
const sub = sub_store.get(stream_id);
|
||||
stream_settings_ui.sub_or_unsub(sub, $stream_row);
|
||||
$("#stream_permission_settings .stream-permissions-warning-banner").empty();
|
||||
},
|
||||
);
|
||||
|
||||
function save_stream_info(e) {
|
||||
const sub = get_sub_for_target(e.currentTarget);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user