Closed jt-wang closed 9 months ago
Theres' a bug that auto grouping doesn't work.
This is because in background.ts, it executes auto grouping only when Chrome local storage isOn is true.
background.ts
isOn
true
const enable = await getStorage<boolean>("isOn"); if ( !enable || !tab.id || !tab.url || window.type != "normal" || !types.length || (tab.status === "complete" && tab.url.startsWith("chrome://")) ) { return; }
However, isOn is by default undefined, because popup.tsx doesn't store isOn value to Chrome local storage, as the only place it sets is when user clicks on disableGrouping.
undefined
popup.tsx
disableGrouping
const disableGrouping = () => { setIsOn((isOn) => { setStorage("isOn", !isOn); return !isOn; }); };
Since isOn is undefined, backtround.ts won't execute auto grouping.
backtround.ts
This PR fixes this.
@MichaelYuhe Great suggestion! updated.
Theres' a bug that auto grouping doesn't work.
This is because in
background.ts
, it executes auto grouping only when Chrome local storageisOn
istrue
.However,
isOn
is by defaultundefined
, becausepopup.tsx
doesn't storeisOn
value to Chrome local storage, as the only place it sets is when user clicks ondisableGrouping
.Since
isOn
isundefined
,backtround.ts
won't execute auto grouping.This PR fixes this.
48 is aimed to avoid such bugs when these states should have been synced across browser storage and React states.