Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

recent_topics: Don't process hotkeys in empty table.

Aman Agrawal5ee78fc14c0e
diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js
index 9548ef9597c..3683b87503e 100644
--- a/static/js/recent_topics_ui.js
+++ b/static/js/recent_topics_ui.js
@@ -1038,6 +1038,11 @@ export function change_focused_element($elt, input_key) {
return true;
}
} else if (is_table_focused()) {
+ // Don't process hotkeys in table if there are no rows.
+ if (!topics_widget || topics_widget.get_current_list().length === 0) {
+ return true;
+ }
+
// For arrowing around the table of topics, we implement left/right
// wraparound. Going off the top or the bottom takes one
// to the navigation at the top (see set_table_focus).