From c2670281b86493e341ad0184a4f269d078e8f5b5 Mon Sep 17 00:00:00 2001 From: Yahor Kazachenka Date: Mon, 14 Apr 2025 09:50:15 +0200 Subject: [PATCH] =?UTF-8?q?the=20code=20for=20resending=20the=20state=20pa?= =?UTF-8?q?tch=20to=20the=20browser=20tabs=20is=20commented=20ou=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wrap-store/wrapStore.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wrap-store/wrapStore.js b/src/wrap-store/wrapStore.js index a0e01db9b..e681300eb 100644 --- a/src/wrap-store/wrapStore.js +++ b/src/wrap-store/wrapStore.js @@ -136,12 +136,17 @@ export default ({ channelName = defaultOpts.channelName } = defaultOpts) => { }; browserAPI.runtime.sendMessage(...args, onErrorCallback); + + /* + * With this approach, if you open the extension in a new tab, we will patch the state twice. + * We still do not use redux for content scripts, so we can rework this code only if necessary. + */ // We will broadcast state changes to all tabs to sync state across content scripts - return browserAPI.tabs.query({}, (tabs) => { - for (const tab of tabs) { - browserAPI.tabs.sendMessage(tab.id, ...args, onErrorCallback); - } - }); + // return browserAPI.tabs.query({}, (tabs) => { + // for (const tab of tabs) { + // browserAPI.tabs.sendMessage(tab.id, ...args, onErrorCallback); + // } + // }); }); let currentState = store.getState();