narrow_state: Use message_lists.current to return current filter.

It doesn't make sense for us to track a separate current filter when
it should just the be filter of current message list if there is one.

This will reduce possible confusion in the codebase where filter
returned by narrow_state is different from message_lists.current.
This commit is contained in:
Aman Agrawal
2024-02-13 02:44:04 +00:00
committed by Tim Abbott
parent f630272b4c
commit c20340a5a6
23 changed files with 176 additions and 148 deletions

View File

@@ -54,7 +54,7 @@ export type MessageList = {
export let home: MessageList | undefined;
export let current: MessageList | undefined;
function set_current(msg_list: MessageList | undefined): void {
export function set_current(msg_list: MessageList | undefined): void {
// NOTE: Use update_current_message_list instead of this function.
current = msg_list;
}