From fd20c57a5b72bf6ab5c37b8fe2ff68ba28e91e54 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Thu, 22 Apr 2021 02:07:44 +0800 Subject: [PATCH] Fix google drive sync spam, hopefully - fix #43 --- src/components/WishImportModal.svelte | 2 ++ src/routes/wish/_summary.svelte | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/components/WishImportModal.svelte b/src/components/WishImportModal.svelte index 5ee27ff3..dd9e48f8 100644 --- a/src/components/WishImportModal.svelte +++ b/src/components/WishImportModal.svelte @@ -407,6 +407,8 @@ submitWishTally(lastPull); } + const prefix = getAccountPrefix(); + updateSave(`${prefix}collectables-updated`, 'true'); closeModal(); } diff --git a/src/routes/wish/_summary.svelte b/src/routes/wish/_summary.svelte index 9054f4f0..696110d7 100644 --- a/src/routes/wish/_summary.svelte +++ b/src/routes/wish/_summary.svelte @@ -54,6 +54,12 @@ } updateCollectedCharacters = true; } + const collectablesNeedUpdateData = readSave(`${prefix}collectables-updated`); + if (collectablesNeedUpdateData === null || collectablesNeedUpdateData === 'true') { + updateCollectedCharacters = true; + } else if (collectablesNeedUpdateData === 'false') { + updateCollectedCharacters = false; + } for (let type of types) { const path = `wish-counter-${type.id}`; @@ -160,7 +166,9 @@ } if (updateCollectedCharacters) { + console.log('updating collectables'); updateSave(`${prefix}characters`, JSON.stringify(collectedCharacters)); + updateSave(`${prefix}collectables-updated`, 'false'); } console.log(avg);