Fix save file got bigger everytime because of backup

pull/1/head
Made Baruna 2021-12-05 01:29:29 +07:00
parent 319052a4a8
commit 30fa15e367
No known key found for this signature in database
GPG Key ID: 5AA5DA16AA5DCEAD
3 changed files with 11 additions and 4 deletions

View File

@ -304,8 +304,8 @@
calculatingPity = true;
// backup first
const oldData = await getLocalSaveJson();
await updateSave(`${prefix}backup`, oldData);
// const oldData = await getLocalSaveJson();
// await updateSave(`${prefix}backup`, oldData);
for (let [code, type] of Object.entries(types)) {
await processWishes(code, type);

View File

@ -68,6 +68,13 @@ const convertTime = (data) => {
};
const convertSave = async () => {
const lfkeys = await localforage.keys();
for (const key of lfkeys) {
if (key.includes('backup')) {
await localforage.removeItem(key);
}
}
const converted = localStorage.getItem(CONVERTED_KEY);
if (converted !== null) return;

View File

@ -50,8 +50,8 @@
<script>
window.AdSlots = window.AdSlots || { cmd: [], disableScripts: ['gpt'] };
</script>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script async src="https://kumo.network-n.com/dist/app.js" site="paimonmoe"></script>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js?n=1"></script>
<script async src="https://kumo.network-n.com/dist/app.js?n=1" site="paimonmoe"></script>
</head>
<body class="font-body h-full bg-background-secondary">
<!-- The application will be rendered inside this element,