From 512f16690a36fa1138a4f6b123a92bba4fc8a504 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 4 Mar 2021 13:04:00 +0000 Subject: [PATCH] settings_streams: Use hash_util to check if settings is open. Since both `organization` and `settings` are category of hash, we can simply check if the current hash's category is among them. --- static/js/settings_streams.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/settings_streams.js b/static/js/settings_streams.js index 71e17ead22..173129d1f1 100644 --- a/static/js/settings_streams.js +++ b/static/js/settings_streams.js @@ -3,6 +3,7 @@ import $ from "jquery"; import render_admin_default_streams_list from "../templates/settings/admin_default_streams_list.hbs"; import * as channel from "./channel"; +import * as hash_util from "./hash_util"; import {$t_html} from "./i18n"; import * as ListWidget from "./list_widget"; import * as loading from "./loading"; @@ -63,7 +64,7 @@ export function build_default_stream_table() { } export function update_default_streams_table() { - if (/#*organization/.test(window.location.hash) || /#*settings/.test(window.location.hash)) { + if (["organization", "settings"].includes(hash_util.get_current_hash_category())) { $("#admin_default_streams_table").expectOne().find("tr.default_stream_row").remove(); build_default_stream_table(); }