Skip to content

Commit ed071cf

Browse files
committed
call persist
1 parent 46141a9 commit ed071cf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Migration/MigrationPage.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ import About from '@/Landing/About.vue';
2929
import Footer from '@/Landing/Footer.vue';
3030
import { usePersistanceService } from '@/services';
3131
import { downloadjs } from '@/Settings/download';
32+
import { onMounted } from 'vue';
3233
3334
const env = import.meta.env;
3435
const domain = env.VITE_MIGRATE_TO_DOMAIN;
3536
3637
const persistanceService = usePersistanceService();
38+
onMounted(() => persistanceService.persist())
3739
const download = async () => {
3840
const file = await persistanceService.stateToFile();
3941
downloadjs(file, file.name, file.type);

src/services/PersistanceService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ class PersistanceService {
6868
});
6969
}
7070

71-
public persist() {
72-
this.loadState().then(() => {
73-
this.main.$subscribe(() => this.saveState(), { deep: true });
74-
});
71+
public async persist() {
72+
await this.loadState();
73+
this.main.$subscribe(() => this.saveState(), { deep: true });
7574
}
7675

7776
public resetStateToDefault() {

0 commit comments

Comments
 (0)