forked from mirrors/misskey
refactor
This commit is contained in:
@@ -27,7 +27,7 @@ export async function load() {
|
||||
scope: ['clickerGame'],
|
||||
key: 'saveData',
|
||||
});
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err.code === 'NO_SUCH_KEY') {
|
||||
saveData.value = {
|
||||
gameVersion: 2,
|
||||
@@ -43,20 +43,6 @@ export async function load() {
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
// migration
|
||||
if (saveData.value.gameVersion === 1) {
|
||||
saveData.value = {
|
||||
gameVersion: 2,
|
||||
cookies: saveData.value.cookies,
|
||||
totalCookies: saveData.value.cookies,
|
||||
totalHandmadeCookies: saveData.value.cookies,
|
||||
clicked: saveData.value.clicked,
|
||||
achievements: [],
|
||||
facilities: [],
|
||||
};
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
export async function save() {
|
||||
|
||||
Reference in New Issue
Block a user