From a0c35c50cdea45c9b3eb49795fe1b0268d48e8f7 Mon Sep 17 00:00:00 2001 From: praschke Date: Fri, 1 Sep 2023 15:57:09 +0100 Subject: fix: page and popup state is destroyed on background wakeup when the background script starts, it sends a `Yomichan.optionsUpdated` message which is retransmitted indiscriminately. - popups are all torn down/refreshed - the search bar on the search page can lose state - if a popup has been loaded on the search page, the search page can redirect/refresh - options being edited can lose state and the options page can refresh --- ext/js/yomichan.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/js/yomichan.js b/ext/js/yomichan.js index 5a55b3ea..a4feaa23 100644 --- a/ext/js/yomichan.js +++ b/ext/js/yomichan.js @@ -214,7 +214,9 @@ class Yomichan extends EventDispatcher { } _onMessageOptionsUpdated({source}) { - this.trigger('optionsUpdated', {source}); + if (source !== 'background') { + this.trigger('optionsUpdated', {source}); + } } _onMessageDatabaseUpdated({type, cause}) { -- cgit v1.2.3