Handle convert error
parent
d21df64719
commit
6c554022ad
|
@ -122,7 +122,11 @@
|
||||||
const converted = convertTime(JSON.parse(remoteSave[key]));
|
const converted = convertTime(JSON.parse(remoteSave[key]));
|
||||||
await updateSave(key, converted, true);
|
await updateSave(key, converted, true);
|
||||||
} else {
|
} 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');
|
console.log('finished convert from google drive');
|
||||||
|
@ -151,7 +155,11 @@
|
||||||
const converted = convertTime(JSON.parse(remoteSave[key]));
|
const converted = convertTime(JSON.parse(remoteSave[key]));
|
||||||
await updateSave(key, converted, true);
|
await updateSave(key, converted, true);
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
await updateSave(key, remoteSave[key], true);
|
await updateSave(key, remoteSave[key], true);
|
||||||
|
|
|
@ -93,7 +93,11 @@ const convertSave = async () => {
|
||||||
const converted = convertTime(JSON.parse(value));
|
const converted = convertTime(JSON.parse(value));
|
||||||
await localforage.setItem(key, converted);
|
await localforage.setItem(key, converted);
|
||||||
} else {
|
} 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')) {
|
if (!key.endsWith('locale')) {
|
||||||
|
|
Loading…
Reference in New Issue