mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
narrow_history: Remove invalid assertion.
Since non message views list channel topic list can have a defined filter, we cannot assume that having `narrow_state.filter` set implies `message_list.current` is defined.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user