From 8f0a0af58833fb7b881d7224f4b86c78a512436a Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Fri, 5 Jul 2024 04:42:14 +0000 Subject: [PATCH] server_events_dispatch: Fix stream archived booked not displayed. Fixed by updating bookend after stream data is deleted. When a stream is deleted and user is narrowed to the stream, stream archived bookend is now displayed correctly. --- web/src/server_events_dispatch.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/server_events_dispatch.js b/web/src/server_events_dispatch.js index abf24b8452..868bd7aaf5 100644 --- a/web/src/server_events_dispatch.js +++ b/web/src/server_events_dispatch.js @@ -553,10 +553,6 @@ export function dispatch_normal_event(event) { const is_narrowed_to_stream = narrow_state.is_for_stream_id( stream.stream_id, ); - if (is_narrowed_to_stream) { - assert(message_lists.current !== undefined); - message_lists.current.update_trailing_bookend(true); - } stream_data.delete_sub(stream.stream_id); stream_settings_ui.remove_stream(stream.stream_id); if (was_subscribed) { @@ -582,6 +578,10 @@ export function dispatch_normal_event(event) { "zulip_update_announcements_stream_id", ); } + if (is_narrowed_to_stream) { + assert(message_lists.current !== undefined); + message_lists.current.update_trailing_bookend(true); + } } stream_list.update_subscribe_to_more_streams_link(); break;