Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
popover_menus: Fix boolean | undefined types.
Anders Kaseorg34ccf15daa13
diff --git a/web/src/popover_menus.ts b/web/src/popover_menus.tsindex 81ad4bc50ac..5defde5f414 100644--- a/web/src/popover_menus.ts+++ b/web/src/popover_menus.ts@@ -99,20 +99,20 @@ export function get_topic_menu_popover(): tippy.Instance | null {return popover_instances.topics_menu;}-export function is_topic_menu_popover_displayed(): boolean | undefined {- return popover_instances.topics_menu?.state.isVisible;+export function is_topic_menu_popover_displayed(): boolean {+ return popover_instances.topics_menu?.state.isVisible ?? false;}-export function is_visibility_policy_popover_displayed(): boolean | undefined {- return popover_instances.change_visibility_policy?.state.isVisible;+export function is_visibility_policy_popover_displayed(): boolean {+ return popover_instances.change_visibility_policy?.state.isVisible ?? false;}export function get_scheduled_messages_popover(): tippy.Instance | null {return popover_instances.send_later;}-export function is_scheduled_messages_popover_displayed(): boolean | undefined {- return popover_instances.send_later?.state.isVisible;+export function is_scheduled_messages_popover_displayed(): boolean {+ return popover_instances.send_later?.state.isVisible ?? false;}export function get_compose_control_buttons_popover(): tippy.Instance | null {@@ -123,24 +123,24 @@ export function get_starred_messages_popover(): tippy.Instance | null {return popover_instances.starred_messages;}-export function is_personal_menu_popover_displayed(): boolean | undefined {- return popover_instances.personal_menu?.state.isVisible;+export function is_personal_menu_popover_displayed(): boolean {+ return popover_instances.personal_menu?.state.isVisible ?? false;}-export function is_gear_menu_popover_displayed(): boolean | undefined {- return popover_instances.gear_menu?.state.isVisible;+export function is_gear_menu_popover_displayed(): boolean {+ return popover_instances.gear_menu?.state.isVisible ?? false;}export function get_gear_menu_instance(): tippy.Instance | null {return popover_instances.gear_menu;}-export function is_help_menu_popover_displayed(): boolean | undefined {- return popover_instances.help_menu?.state.isVisible;+export function is_help_menu_popover_displayed(): boolean {+ return popover_instances.help_menu?.state.isVisible ?? false;}-export function is_message_actions_popover_displayed(): boolean | undefined {- return popover_instances.message_actions?.state.isVisible;+export function is_message_actions_popover_displayed(): boolean {+ return popover_instances.message_actions?.state.isVisible ?? false;}function get_popover_items_for_instance(instance: tippy.Instance): JQuery | undefined {diff --git a/web/src/user_topics_ui.ts b/web/src/user_topics_ui.tsindex de1601c8d48..7dfc68528ea 100644--- a/web/src/user_topics_ui.ts+++ b/web/src/user_topics_ui.ts@@ -16,13 +16,13 @@ import * as unread_ui from "./unread_ui.ts";import * as user_topics from "./user_topics.ts";import type {ServerUserTopic} from "./user_topics.ts";-function should_add_topic_update_delay(visibility_policy: number): boolean | undefined {+function should_add_topic_update_delay(visibility_policy: number): boolean {// If topic visibility related popovers are active, add a delay to all methods that// hide the topic on mute. This allows the switching animations to complete before the// popover is force closed due to the reference element being removed from view.const is_topic_muted = visibility_policy === user_topics.all_visibility_policies.MUTED;const is_relevant_popover_open =- popover_menus.is_topic_menu_popover_displayed() ??+ popover_menus.is_topic_menu_popover_displayed() ||popover_menus.is_visibility_policy_popover_displayed();// Don't add delay if the user is in inbox view or topics narrow, since