From a1aba2869b12d560bd3078ee11e7b7aca426b591 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 2 Nov 2022 11:39:58 -0700 Subject: [PATCH] settings_org: Fix exception processing stream type events. The previous check looked at whether the settings overlay as a whole was open, not whether the specific panel we're going to update was rendered. The other code paths calling from server_events_dispatch into this module already correctly check meta.loaded. --- frontend_tests/node_tests/settings_org.js | 3 --- static/js/settings_org.js | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.js index 8d0f3fa63a..c040f7f93a 100644 --- a/frontend_tests/node_tests/settings_org.js +++ b/frontend_tests/node_tests/settings_org.js @@ -14,7 +14,6 @@ const noop = () => {}; const realm_icon = mock_esm("../../static/js/realm_icon"); const channel = mock_esm("../../static/js/channel"); -const overlays = mock_esm("../../static/js/overlays"); mock_esm("../../static/js/csrf", {csrf_token: "token-stub"}); mock_esm("../../static/js/list_widget", { @@ -309,8 +308,6 @@ function test_extract_property_name() { } function test_sync_realm_settings() { - overlays.settings_open = () => true; - { /* Test invalid settings property sync */ const $property_elem = $("#id_realm_invalid_settings_property"); diff --git a/static/js/settings_org.js b/static/js/settings_org.js index f2af77b462..f4edd1d218 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -11,7 +11,6 @@ import {csrf_token} from "./csrf"; import {DropdownListWidget} from "./dropdown_list_widget"; import {$t, $t_html, get_language_name} from "./i18n"; import * as loading from "./loading"; -import * as overlays from "./overlays"; import {page_params} from "./page_params"; import * as realm_icon from "./realm_icon"; import * as realm_logo from "./realm_logo"; @@ -590,7 +589,7 @@ function discard_property_element_changes(elem, for_realm_default_settings) { } export function sync_realm_settings(property) { - if (!overlays.settings_open()) { + if (!meta.loaded) { return; }