Skip to content

Commit

Permalink
settings: await for settings store initialization for running tour
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Jan 10, 2025
1 parent 198b179 commit f67ce24
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions core/frontend/src/libs/settings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import vuetify from '@/plugins/vuetify'
import settingsStore from '@/store/settings'
import settingsStore, { SettingsStore } from '@/store/settings'

class Settings {
// eslint-disable-next-line
Expand Down Expand Up @@ -55,16 +55,14 @@ class Settings {
}

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

settingsStore.setTourVersion(version)
resolve()
})
await settingsStore.setTourVersion(version)
}
}

Expand Down

0 comments on commit f67ce24

Please sign in to comment.