From 4325f8a436f985d7a6f186d227886e8ffc4ef49b Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Sun, 9 Jun 2024 13:24:13 +1000 Subject: [PATCH] fix: shortcut enable/disable inverted --- src/seqta/utils/listeners/StorageChanges.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/seqta/utils/listeners/StorageChanges.ts b/src/seqta/utils/listeners/StorageChanges.ts index d371d902..864a0398 100644 --- a/src/seqta/utils/listeners/StorageChanges.ts +++ b/src/seqta/utils/listeners/StorageChanges.ts @@ -11,6 +11,7 @@ import { } from '../../../SEQTA'; import { updateBgDurations } from '../../ui/Animation'; import browser from 'webextension-polyfill'; +import { CustomShortcut } from '../../../types/storage'; export class StorageChangeHandler { constructor() { @@ -41,7 +42,7 @@ export class StorageChangeHandler { browser.runtime.sendMessage({ type: 'reloadTabs' }); } - private handleNotificationCollectorChange(newValue: any) { + private handleNotificationCollectorChange(newValue: boolean) { if (newValue) { enableNotificationCollector(); } else { @@ -49,7 +50,7 @@ export class StorageChangeHandler { } } - private handleCustomShortcutsChange(oldValue: any, newValue: any) { + private handleCustomShortcutsChange(newValue: CustomShortcut[], oldValue: CustomShortcut[]) { if (newValue) { if (newValue.length > oldValue.length) { CreateCustomShortcutDiv(newValue[oldValue.length]); @@ -65,7 +66,8 @@ export class StorageChangeHandler { } } - private handleShortcutsChange(oldValue: any, newValue: any) { + private handleShortcutsChange(newValue: { enabled: boolean, name: string }[], oldValue: { enabled: boolean, name: string }[]) { + console.log(oldValue, newValue); const addedShortcuts = newValue.filter((newItem: any) => { const isAdded = oldValue.some((oldItem: any) => { const match = oldItem.name === newItem.name; @@ -92,7 +94,7 @@ export class StorageChangeHandler { RemoveShortcutDiv(removedShortcuts); } - private handleBksliderInputChange(newValue: any) { + private handleBksliderInputChange(newValue: string) { updateBgDurations(newValue); }