From 31cfd16f85b084a2bc9eba1dc775cfbe0ab37611 Mon Sep 17 00:00:00 2001 From: YJDave Date: Thu, 4 Jan 2018 10:42:17 +0530 Subject: [PATCH] stream settings: Update subscription-btn display instant. If user unsubscribe from private stream, then immediately remove subscription option from settings. --- static/js/subs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/subs.js b/static/js/subs.js index cffc9e748a..f7d117892f 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -246,6 +246,12 @@ exports.update_settings_for_unsubscribed = function (sub) { stream_edit.rerender_subscribers_list(sub); } + // If user unsubscribed from private stream then user can not subscribe to + // stream without invitation. So hide subscribe button. + stream_data.update_calculated_fields(sub); + if (!sub.should_display_subscription_button) { + settings_button.hide(); + } row_for_stream_id(subs.stream_id).attr("data-temp-view", true); };