refactor: improve type checking for DispatchingStore dispatch payloads

This commit is contained in:
Andrew Bastin
2023-02-14 14:09:32 +05:30
parent cb5fff0310
commit b27fe871c4
11 changed files with 85 additions and 57 deletions

View File

@@ -6,7 +6,7 @@ import {
setDoc,
} from "firebase/firestore"
import { platform } from "~/platform"
import { applySetting, settingsStore, SettingsType } from "~/newstore/settings"
import { applySetting, settingsStore, SettingsDef } from "~/newstore/settings"
/**
* Used locally to prevent infinite loop when settings sync update
@@ -59,7 +59,7 @@ export function initSettings() {
} else {
writeSettings(
dispatch.payload.settingKey,
settingsStore.value[dispatch.payload.settingKey as keyof SettingsType]
settingsStore.value[dispatch.payload.settingKey as keyof SettingsDef]
)
}
}