mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-23 07:17:43 +01:00
Handle convert error
This commit is contained in:
parent
d21df64719
commit
6c554022ad
2 changed files with 15 additions and 3 deletions
|
@ -122,7 +122,11 @@
|
|||
const converted = convertTime(JSON.parse(remoteSave[key]));
|
||||
await updateSave(key, converted, true);
|
||||
} else {
|
||||
await updateSave(key, JSON.parse(remoteSave[key]), true);
|
||||
try {
|
||||
await updateSave(key, JSON.parse(remoteSave[key]), true);
|
||||
} catch (err) {
|
||||
await updateSave(key, remoteSave[key], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('finished convert from google drive');
|
||||
|
@ -151,7 +155,11 @@
|
|||
const converted = convertTime(JSON.parse(remoteSave[key]));
|
||||
await updateSave(key, converted, true);
|
||||
} else {
|
||||
await updateSave(key, JSON.parse(remoteSave[key]), true);
|
||||
try {
|
||||
await updateSave(key, JSON.parse(remoteSave[key]), true);
|
||||
} catch (err) {
|
||||
await updateSave(key, remoteSave[key], true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await updateSave(key, remoteSave[key], true);
|
||||
|
|
|
@ -93,7 +93,11 @@ const convertSave = async () => {
|
|||
const converted = convertTime(JSON.parse(value));
|
||||
await localforage.setItem(key, converted);
|
||||
} else {
|
||||
await localforage.setItem(key, JSON.parse(value));
|
||||
try {
|
||||
await localforage.setItem(key, JSON.parse(value));
|
||||
} catch (err) {
|
||||
await localforage.setItem(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
if (!key.endsWith('locale')) {
|
||||
|
|
Loading…
Reference in a new issue