From ba9cfc2cd86ffc4e3904b96be0708a7f7d82c727 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Mon, 26 Jun 2023 09:43:17 -0700 Subject: [PATCH] update_messages: Compare to compose stream by id instead of name. --- web/src/message_events.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/message_events.js b/web/src/message_events.js index 9d1c191922..2e0f37361f 100644 --- a/web/src/message_events.js +++ b/web/src/message_events.js @@ -268,8 +268,7 @@ export function update_messages(events) { event.propagate_mode, ); - const stream_name = stream_archived ? undefined : old_stream.name; - const compose_stream_name = compose_state.stream_name(); + const compose_stream_id = compose_state.stream_id(); const orig_topic = util.get_edit_event_orig_topic(event); const current_filter = narrow_state.filter(); @@ -289,9 +288,9 @@ export function update_messages(events) { if ( going_forward_change && - stream_name && - compose_stream_name && - stream_name.toLowerCase() === compose_stream_name.toLowerCase() && + !stream_archived && + compose_stream_id && + old_stream.stream_id === compose_stream_id && orig_topic === compose_state.topic() ) { changed_compose = true; @@ -373,6 +372,7 @@ export function update_messages(events) { }); } + const old_stream_name = stream_archived ? undefined : old_stream.name; if ( going_forward_change && // This logic is a bit awkward. What we're trying to @@ -390,7 +390,7 @@ export function update_messages(events) { // messages within a narrow. selection_changed_topic && current_filter && - current_filter.has_topic(stream_name, orig_topic) + current_filter.has_topic(old_stream_name, orig_topic) ) { let new_filter = current_filter; if (new_filter && stream_changed) {