Skip to content

Commit c267028

Browse files
committed
the code for resending the state patch to the browser tabs is commented ouе
1 parent 4fab518 commit c267028

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/wrap-store/wrapStore.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,17 @@ export default ({ channelName = defaultOpts.channelName } = defaultOpts) => {
136136
};
137137

138138
browserAPI.runtime.sendMessage(...args, onErrorCallback);
139+
140+
/*
141+
* With this approach, if you open the extension in a new tab, we will patch the state twice.
142+
* We still do not use redux for content scripts, so we can rework this code only if necessary.
143+
*/
139144
// We will broadcast state changes to all tabs to sync state across content scripts
140-
return browserAPI.tabs.query({}, (tabs) => {
141-
for (const tab of tabs) {
142-
browserAPI.tabs.sendMessage(tab.id, ...args, onErrorCallback);
143-
}
144-
});
145+
// return browserAPI.tabs.query({}, (tabs) => {
146+
// for (const tab of tabs) {
147+
// browserAPI.tabs.sendMessage(tab.id, ...args, onErrorCallback);
148+
// }
149+
// });
145150
});
146151

147152
let currentState = store.getState();

0 commit comments

Comments
 (0)