Fix google drive sync spam, hopefully

- fix #43
pull/1/head
Made Baruna 2021-04-22 02:07:44 +08:00
parent 758766154c
commit fd20c57a5b
No known key found for this signature in database
GPG Key ID: 5AA5DA16AA5DCEAD
2 changed files with 10 additions and 0 deletions

View File

@ -407,6 +407,8 @@
submitWishTally(lastPull);
}
const prefix = getAccountPrefix();
updateSave(`${prefix}collectables-updated`, 'true');
closeModal();
}

View File

@ -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);