From ee084029e5b41f258a9cfc836c72bd099365e99d Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 17 Feb 2024 16:57:16 -0600 Subject: [PATCH] Sync deleting saves to cloud --- src/components/saves/SavesManager.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/saves/SavesManager.vue b/src/components/saves/SavesManager.vue index ceeae6f..9e32a9a 100644 --- a/src/components/saves/SavesManager.vue +++ b/src/components/saves/SavesManager.vue @@ -204,6 +204,23 @@ function duplicateSave(id: string) { } function deleteSave(id: string) { + if (galaxy.value?.loggedIn) { + galaxy.value.getSaveList().then(list => { + const slot = Object.keys(list).find(slot => { + const content = list[slot as unknown as number].content; + try { + if (JSON.parse(content).id === id) { + return true; + } + } catch (e) { + return false; + } + }); + if (slot != null) { + galaxy.value?.save(parseInt(slot), "", "").catch(console.error); + } + }); + } settings.saves = settings.saves.filter((save: string) => save !== id); localStorage.removeItem(id); clearCachedSave(id);