chore: fix build

This commit is contained in:
2024-02-10 11:19:18 +07:00
parent 739ba63e6c
commit 35c5b5fb78
10 changed files with 136 additions and 43 deletions

View File

@@ -30,9 +30,15 @@ export class LumeStorage {
}
public async loadSettings() {
const settings: Settings = JSON.parse(await this.#store.get("settings"));
for (const [key, value] of Object.entries(settings)) {
this.settings[key] = value;
const data = await this.#store.get("settings");
if (!data) return;
const settings = JSON.parse(data as string) as Settings;
if (Object.keys(settings).length) {
for (const [key, value] of Object.entries(settings)) {
this.settings[key] = value;
}
}
}