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:
Yashashvi Dave 2018-08-07 19:11:00 +05:30 committed by Tim Abbott
parent 290388e5e0
commit 55325b71a4
3 changed files with 5 additions and 3 deletions

View File

@ -237,8 +237,8 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
} else if (event.op === 'delete') {
_.each(event.streams, function (stream) {
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);
stream_data.delete_sub(stream.stream_id);
if (was_subscribed) {
stream_list.remove_sidebar_row(stream.stream_id);
}

View File

@ -668,8 +668,6 @@ exports.initialize = function () {
}
var row = $(".stream-row.active");
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 () {

View File

@ -250,6 +250,10 @@ exports.remove_stream = function (stream_id) {
// stream, but we let jQuery silently handle that.
var row = row_for_stream_id(stream_id);
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) {