message_list: Avoid rerender of user sidebar when adding msgs.

Added methods to live update user sidebar when messages are
added or removed from the message list without doing a complete
rerender.
This commit is contained in:
Aman Agrawal
2025-01-10 07:42:57 +00:00
committed by Tim Abbott
parent df0d3b25c9
commit 4385005200
5 changed files with 49 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ import * as buddy_data from "./buddy_data.ts";
import {buddy_list} from "./buddy_list.ts";
import * as keydown_util from "./keydown_util.ts";
import {ListCursor} from "./list_cursor.ts";
import * as narrow_state from "./narrow_state.ts";
import * as people from "./people.ts";
import * as pm_list from "./pm_list.ts";
import * as popovers from "./popovers.ts";
@@ -96,6 +97,14 @@ export function redraw_user(user_id: number): void {
update_presence_indicators();
}
export function rerender_user_sidebar_participants(): void {
if (!narrow_state.stream_id() || !narrow_state.topic()) {
return;
}
buddy_list.rerender_participants();
}
export function check_should_redraw_new_user(user_id: number): boolean {
if (realm.realm_presence_disabled) {
return false;