Skip to content

Commit 184d7a3

Browse files
Williangalvanipatrickelectric
authored andcommitted
settings: await for settings store initialization for running tour
1 parent a17ed48 commit 184d7a3

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

core/frontend/src/libs/settings.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import vuetify from '@/plugins/vuetify'
2-
import settingsStore from '@/store/settings'
2+
import settingsStore, { SettingsStore } from '@/store/settings'
33

44
class Settings {
55
// eslint-disable-next-line
@@ -55,16 +55,14 @@ class Settings {
5555
}
5656

5757
// eslint-disable-next-line
58-
run_tour_version(version: number) : Promise<void> {
59-
return new Promise((resolve) => {
60-
const store_tour_version = settingsStore.tour_version
61-
if (version === store_tour_version) {
62-
throw new Error(`Tour version (${version}) is the same as in store (${store_tour_version}})`)
63-
}
58+
async run_tour_version(version: number): Promise<void> {
59+
await SettingsStore.start()
60+
const store_tour_version = settingsStore.tour_version
61+
if (version === store_tour_version) {
62+
throw new Error(`Tour version (${version}) is the same as in store (${store_tour_version}})`)
63+
}
6464

65-
settingsStore.setTourVersion(version)
66-
resolve()
67-
})
65+
await settingsStore.setTourVersion(version)
6866
}
6967
}
7068

0 commit comments

Comments
 (0)