From ab6fd871613200c6c5e0b7d49b2af7318ca95df9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 4 Nov 2016 16:11:45 -0700 Subject: [PATCH] subs: Fix rename stream handling of email addresses. --- static/js/subs.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/static/js/subs.js b/static/js/subs.js index 18210aee12..42f6f50009 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -178,6 +178,10 @@ function update_stream_name(stream_id, old_name, new_name) { // Update the left sidebar. stream_list.rename_stream(sub, new_name); + // Update the stream settings + var sub_settings = settings_for_sub(stream_data.get_sub_by_id(stream_id)); + sub_settings.find(".email-address").text(sub.email_address); + // Update the subscriptions page var sub_row = $(".stream-row[data-stream-id='" + sub.stream_id + "']"); sub_row.find(".stream-name").text(new_name); @@ -1035,11 +1039,6 @@ $(function () { data: {"new_name": JSON.stringify(new_name)}, success: function (data) { new_name_box.val(''); - // Update all visible instances of the old name to the new name. - old_name_box.text(new_name); - sub_settings = settings_for_sub(stream_data.get_sub_by_id(stream_id)); - sub_settings.find(".email-address").text(data.email_address); - ui.report_success(i18n.t("The stream has been renamed!"), $("#subscriptions-status "), 'subscriptions-status'); },