streams: Redirect to subscribed-tab on unsubscription for guest user.

This commit add code to redirect guest users to
subscribed-stream-tab and removes the recently-unsubscribed
stream from settings tab on unsubscription.
This commit is contained in:
Yashashvi Dave 2019-05-09 11:04:31 +05:30 committed by Tim Abbott
parent b68c1bb6ac
commit 3f38fc6b79
2 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,7 @@ exports.update_stream_row_in_settings_tab = function (sub) {
var sub_row = subs.row_for_stream_id(sub.stream_id);
if (sub.subscribed) {
sub_row.removeClass("notdisplayed");
} else if (sub.invite_only) {
} else if (sub.invite_only || page_params.is_guest) {
sub_row.addClass("notdisplayed");
}
}

View File

@ -320,6 +320,9 @@ exports.update_settings_for_unsubscribed = function (sub) {
if (!sub.should_display_subscription_button) {
stream_ui_updates.update_add_subscriptions_elements(sub);
}
if (page_params.is_guest) {
stream_edit.open_edit_panel_empty();
}
// Remove private streams from subscribed streams list.
stream_ui_updates.update_stream_row_in_settings_tab(sub);