zulip/web/src/message_scroll_state.ts
Tim Abbott 0f01eae655 narrow: Simplify actively_scrolling data flow.
There's no good reason to have the caller of deactivate pass this
parameter in.

This effectively reverts a18b1662cb,
which did this as part of trying to avoid an import cycle, with a more
appropriate solution using the existing message_scroll_state module.

Importantly, it also means that we again wait for scrolls longer than
50ms to finish before opening All messages; I think this might fix a
regression.
2023-11-15 17:33:21 -08:00

23 lines
760 B
TypeScript

// Tracks whether the next scroll that will complete is initiated by
// code, not the user, and thus should avoid moving the selected
// message.
export let update_selection_on_next_scroll = true;
export function set_update_selection_on_next_scroll(value: boolean): void {
update_selection_on_next_scroll = value;
}
// Whether a keyboard shortcut is triggering a message feed scroll event.
export let keyboard_triggered_current_scroll = false;
export function set_keyboard_triggered_current_scroll(value: boolean): void {
keyboard_triggered_current_scroll = value;
}
// Whether a scroll is currently occurring.
export let actively_scrolling = false;
export function set_actively_scrolling(value: boolean): void {
actively_scrolling = value;
}