subscriptions: Clear email address on unsubscriptions from stream.

Currently, even after unsubscribing from private/public stream
email address of stream is still present in html widgets hidden.
Cause we don't clear email address on unsubscription event.

This clears email address from widget when user unsubscribe
from any stream.
This commit is contained in:
YJDave 2018-04-07 09:35:52 +05:30 committed by Tim Abbott
parent f15ddc93e0
commit 21d1133c4f
2 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,8 @@ exports.rerender_subscribers_list = function (sub) {
exports.hide_sub_settings = function (sub) {
var $settings = $(".subscription_settings[data-stream-id='" + sub.stream_id + "']");
$settings.find(".regular_subscription_settings").removeClass('in');
// Clear email address widget
$settings.find(".email-address").html("");
};
exports.show_sub_settings = function (sub) {

View File

@ -252,6 +252,7 @@ exports.update_settings_for_unsubscribed = function (sub) {
stream_edit.hide_sub_settings(sub);
var active_stream = exports.active_stream();
stream_data.update_stream_email_address(sub, "");
if (active_stream !== undefined && active_stream.id === sub.stream_id) {
stream_edit.rerender_subscribers_list(sub);