From d10d72e6a9edbc42440894826125ed1e819a3707 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Mon, 11 Mar 2024 04:06:09 +0000 Subject: [PATCH] narrow_state: Change source of truth for is_message_feed_visible. --- web/src/narrow_state.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/narrow_state.ts b/web/src/narrow_state.ts index 1cdc9ae64a..0dd4276d59 100644 --- a/web/src/narrow_state.ts +++ b/web/src/narrow_state.ts @@ -1,10 +1,8 @@ import * as blueslip from "./blueslip"; import {Filter} from "./filter"; -import * as inbox_util from "./inbox_util"; import * as message_lists from "./message_lists"; import {page_params} from "./page_params"; import * as people from "./people"; -import * as recent_view_util from "./recent_view_util"; import type {NarrowTerm} from "./state_data"; import * as stream_data from "./stream_data"; import type {StreamSubscription} from "./sub_store"; @@ -32,7 +30,11 @@ export function search_terms(current_filter: Filter | undefined = filter()): Nar } export function is_message_feed_visible(): boolean { - return !recent_view_util.is_visible() && !inbox_util.is_visible(); + // It's important that `message_lists.current` is the + // source of truth for this since during the initial app load, + // `message_lists.current` is `undefined` and we don't want + // to return `true` if we haven't loaded the message feed yet. + return message_lists.current !== undefined; } export function update_email(