From cfdba6ddad15797923012c4f63c3269054a86bac Mon Sep 17 00:00:00 2001 From: Kuiprux Date: Mon, 26 Jun 2023 02:02:04 +0900 Subject: [PATCH 1/2] Added break on every case --- src/ts/plugins/plugins.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ts/plugins/plugins.ts b/src/ts/plugins/plugins.ts index 06047070..ad987be3 100644 --- a/src/ts/plugins/plugins.ts +++ b/src/ts/plugins/plugins.ts @@ -197,6 +197,7 @@ export async function loadPlugins() { } case "useTranslator": { pluginTranslator = true + break } case "fetch": { postMsgPluginWorker('fetchData',{ @@ -238,11 +239,13 @@ export async function loadPlugins() { id: data.body.id, data: char }) + break } case "setChar":{ const db = get(DataBase) const charid = get(selectedCharID) db.characters[charid] = data.body + break } case "log":{ console.log(data.body) From 41aba65c02f102834e0838464aa8fd249484d376 Mon Sep 17 00:00:00 2001 From: ASDF9999 Date: Mon, 26 Jun 2023 00:41:32 +0700 Subject: [PATCH 2/2] [fix] Fixed a bug where new users showed "Your save file is corrupted" due to a null exception --- src/ts/storage/globalApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/storage/globalApi.ts b/src/ts/storage/globalApi.ts index ceaaea86..662ad1b8 100644 --- a/src/ts/storage/globalApi.ts +++ b/src/ts/storage/globalApi.ts @@ -310,7 +310,8 @@ export async function loadData() { else{ let gotStorage:Uint8Array = await forageStorage.getItem('database/database.bin') if(checkNullish(gotStorage)){ - await forageStorage.setItem('database/database.bin', encodeRisuSave({})) + gotStorage = encodeRisuSave({}) + await forageStorage.setItem('database/database.bin', gotStorage) } try { setDatabase(