From 3f38fc6b793bbc40877dc39ddd122f824d62bc7d Mon Sep 17 00:00:00 2001 From: Yashashvi Dave Date: Thu, 9 May 2019 11:04:31 +0530 Subject: [PATCH] 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. --- static/js/stream_ui_updates.js | 2 +- static/js/subs.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/stream_ui_updates.js b/static/js/stream_ui_updates.js index b3911410bd..0e6024dc3c 100644 --- a/static/js/stream_ui_updates.js +++ b/static/js/stream_ui_updates.js @@ -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"); } } diff --git a/static/js/subs.js b/static/js/subs.js index 4f05a5d43f..08fa4bb380 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -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);