eslint: Fix @typescript-eslint/prefer-optional-chain.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-10-24 14:07:49 -07:00
committed by Tim Abbott
parent 8396c14cdc
commit cd1ced82d6
9 changed files with 13 additions and 19 deletions

View File

@@ -1199,7 +1199,7 @@ function process_hotkey(e: JQuery.KeyDownEvent, hotkey: Hotkey): boolean {
case "toggle_topic_visibility_policy":
if (recent_view_ui.is_in_focus()) {
const recent_msg = recent_view_ui.get_focused_row_message();
if (recent_msg !== undefined && recent_msg.type === "stream") {
if (recent_msg?.type === "stream") {
user_topics_ui.toggle_topic_visibility_policy(recent_msg);
return true;
}
@@ -1217,13 +1217,13 @@ function process_hotkey(e: JQuery.KeyDownEvent, hotkey: Hotkey): boolean {
case "list_of_channel_topics":
if (recent_view_ui.is_in_focus()) {
const msg = recent_view_ui.get_focused_row_message();
if (msg !== undefined && msg.type === "stream") {
if (msg?.type === "stream") {
list_of_channel_topics_channel_id = msg.stream_id;
}
}
if (inbox_ui.is_in_focus()) {
const msg = inbox_ui.get_focused_row_message();
if (msg !== undefined && msg.msg_type === "stream") {
if (msg?.msg_type === "stream") {
list_of_channel_topics_channel_id = msg.stream_id;
}
}