mirror of https://github.com/zulip/zulip.git
stream settings: Display nothing-selected when active-stream is deleted.
Display nothing-selected in stream settings tab, if we get delete-stream event of active-stream(which stream's settings tab is opened) in frontend.
This commit is contained in:
parent
290388e5e0
commit
55325b71a4
|
@ -237,8 +237,8 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
||||||
} else if (event.op === 'delete') {
|
} else if (event.op === 'delete') {
|
||||||
_.each(event.streams, function (stream) {
|
_.each(event.streams, function (stream) {
|
||||||
var was_subscribed = stream_data.get_sub_by_id(stream.stream_id).subscribed;
|
var was_subscribed = stream_data.get_sub_by_id(stream.stream_id).subscribed;
|
||||||
stream_data.delete_sub(stream.stream_id);
|
|
||||||
subs.remove_stream(stream.stream_id);
|
subs.remove_stream(stream.stream_id);
|
||||||
|
stream_data.delete_sub(stream.stream_id);
|
||||||
if (was_subscribed) {
|
if (was_subscribed) {
|
||||||
stream_list.remove_sidebar_row(stream.stream_id);
|
stream_list.remove_sidebar_row(stream.stream_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -668,8 +668,6 @@ exports.initialize = function () {
|
||||||
}
|
}
|
||||||
var row = $(".stream-row.active");
|
var row = $(".stream-row.active");
|
||||||
exports.delete_stream(stream_id, $(".stream_change_property_info"), row);
|
exports.delete_stream(stream_id, $(".stream_change_property_info"), row);
|
||||||
$(".settings").hide();
|
|
||||||
$(".nothing-selected").show();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#subscriptions_table").on("hide.bs.modal", "#deactivation_stream_modal", function () {
|
$("#subscriptions_table").on("hide.bs.modal", "#deactivation_stream_modal", function () {
|
||||||
|
|
|
@ -250,6 +250,10 @@ exports.remove_stream = function (stream_id) {
|
||||||
// stream, but we let jQuery silently handle that.
|
// stream, but we let jQuery silently handle that.
|
||||||
var row = row_for_stream_id(stream_id);
|
var row = row_for_stream_id(stream_id);
|
||||||
row.remove();
|
row.remove();
|
||||||
|
var sub = stream_data.get_sub_by_id(stream_id);
|
||||||
|
if (stream_edit.is_sub_settings_active(sub)) {
|
||||||
|
exports.show_subs_pane.nothing_selected();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update_settings_for_subscribed = function (sub) {
|
exports.update_settings_for_subscribed = function (sub) {
|
||||||
|
|
Loading…
Reference in New Issue