fix: settingsState saving all storage data to settingsState.data incorrectly

This commit is contained in:
sethburkart123
2024-06-20 09:54:38 +10:00
parent f1986879a7
commit ba5357561b
3 changed files with 4 additions and 2 deletions
+3
View File
@@ -65,6 +65,9 @@ async function init() {
if (settingsState.onoff) {
enableCurrentTheme()
//console.log(await browser.storage.local.get())
//settingsState.bksliderinput = '10'
//console.log(await browser.storage.local.get())
// TEMP FIX for bug! -> this is a hack to get the injected.css file to have HMR in development mode as this import system is currently broken with crxjs
if (import.meta.env.MODE === 'development') {
@@ -16,7 +16,6 @@ const Shortcuts = memo(() => {
const [isFormVisible, setFormVisible] = useState(false);
const [newURL, setNewURL] = useState<string>("");
const switchChange = useCallback((shortcutName: string, isOn: boolean) => {
setSettingsState((prevState) => {
const updatedShortcuts = prevState.shortcuts.map((shortcut) =>
+1 -1
View File
@@ -21,7 +21,7 @@ class StorageManager {
return Reflect.get(target.data, prop);
},
set: (target, prop: keyof SettingsState, value) => {
Reflect.set(target.data, prop, value);
Reflect.set(target, prop, value);
target.saveToStorage();
return true;
},