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.

narrow_history: Remove invalid assertion.

Aman Agrawal623fa98976a3
diff --git a/web/src/narrow_history.ts b/web/src/narrow_history.ts
index e2be1770cfb..214f0c95c08 100644
--- a/web/src/narrow_history.ts
+++ b/web/src/narrow_history.ts
@@ -26,12 +26,12 @@ function is_URL_hash_same_as_filter_hash(filter: Filter): boolean {
// history, so that we are able to restore it if the user
// navigates back to this page.
function _save_narrow_state(): void {
- const current_filter = narrow_state.filter();
- if (current_filter === undefined) {
+ if (message_lists.current === undefined) {
return;
}
- assert(message_lists.current !== undefined);
+ const current_filter = narrow_state.filter();
+ assert(current_filter !== undefined);
// Only save state if the URL hash matches the filter terms.
if (!is_URL_hash_same_as_filter_hash(current_filter)) {
return;