Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
recent_view: Live-update folder filter on subscription and folder changes.
Alya Abbottaaad9ca27158
diff --git a/web/src/server_events_dispatch.js b/web/src/server_events_dispatch.jsindex cf6d1275d1e..033ae7384b5 100644--- a/web/src/server_events_dispatch.js+++ b/web/src/server_events_dispatch.js@@ -124,6 +124,7 @@ export function dispatch_normal_event(event) {case "add": {channel_folders.add(event.channel_folder);inbox_ui.complete_rerender();+ recent_view_ui.complete_rerender();settings_folders.populate_channel_folders();stream_ui_updates.update_folder_dropdown_visibility();break;@@ -132,6 +133,7 @@ export function dispatch_normal_event(event) {channel_folders.update(event);if (event.data.name !== undefined) {inbox_ui.complete_rerender();+ recent_view_ui.complete_rerender();stream_list.update_streams_sidebar();stream_settings_ui.update_channel_folder_name(event.channel_folder_id);}@@ -149,6 +151,7 @@ export function dispatch_normal_event(event) {stream_list.update_streams_sidebar();settings_folders.populate_channel_folders();inbox_ui.complete_rerender();+ recent_view_ui.complete_rerender();break;default:blueslip.error("Unexpected event type channel_folder/" + event.op);diff --git a/web/src/stream_events.ts b/web/src/stream_events.tsindex 1b237433faf..79b70d7ec08 100644--- a/web/src/stream_events.ts+++ b/web/src/stream_events.ts@@ -235,6 +235,7 @@ export function update_property<P extends keyof UpdatableStreamProperties>(folder_id(value) {stream_settings_ui.update_channel_folder(sub, value);channel_folders_ui.update_channel_folder_channels_list(stream_id, value);+ recent_view_ui.complete_rerender();},};@@ -342,6 +343,10 @@ export function mark_subscribed(// The new stream in sidebar might need its unread counts// re-calculated.unread_ui.update_unread_counts();++ // If the recent view folder filter is active, the new subscription+ // may belong to the currently selected folder.+ recent_view_ui.complete_rerender();}export function mark_unsubscribed(sub: StreamSubscription): void {@@ -377,6 +382,10 @@ export function mark_unsubscribed(sub: StreamSubscription): void {stream_list.remove_sidebar_row(sub.stream_id);stream_list.update_subscribe_to_more_streams_link();user_profile.update_user_profile_streams_list_for_users([people.my_current_user_id()]);++ // If the recent view folder filter is active, the unsubscribed+ // channel may have been in the currently selected folder.+ recent_view_ui.complete_rerender();}export function report_error_if_user_still_has_subscriptions(user_id: number): void {