fix: add missing defaults option to plugin-store load() call (#288)

The plugin-store 2.4.1 requires the 'defaults' property in StoreOptions.
Previously, only 'autoSave: false' was provided, causing a TypeScript error.
Now passing DEFAULT_SETTINGS as the defaults value.
This commit is contained in:
Jinhyeok Lee 2025-11-04 00:33:11 +09:00 committed by GitHub
parent 951283ca8a
commit d274a28dbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,7 +134,10 @@ export const useSettingsStore = create<SettingsStore>()(
refreshSettings: async () => {
try {
const { load } = await import("@tauri-apps/plugin-store");
const store = await load("settings_store.json", { autoSave: false });
const store = await load("settings_store.json", {
defaults: DEFAULT_SETTINGS,
autoSave: false
});
const settings = (await store.get("settings")) as Settings;
// Load additional settings that come from invoke calls