fix onboarding stuck on welcome
This commit is contained in:
parent
3f1b313fa4
commit
b2dd4ea0f5
1 changed files with 11 additions and 6 deletions
|
@ -14,14 +14,18 @@ type OnboardingStep =
|
||||||
const OnboardingStepsArray = Object.values(OnboardingScreenSteps)
|
const OnboardingStepsArray = Object.values(OnboardingScreenSteps)
|
||||||
export class OnboardingModel {
|
export class OnboardingModel {
|
||||||
// state
|
// state
|
||||||
step: OnboardingStep
|
step: OnboardingStep = 'Welcome'
|
||||||
|
|
||||||
constructor(public rootStore: RootStoreModel) {
|
constructor(public rootStore: RootStoreModel) {
|
||||||
makeAutoObservable(this, {rootStore: false})
|
makeAutoObservable(this, {
|
||||||
this.step = 'Welcome'
|
rootStore: false,
|
||||||
|
hydrate: false,
|
||||||
|
serialize: false,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize() {
|
serialize(): unknown {
|
||||||
|
console.log('serializing onboarding', this.step)
|
||||||
return {
|
return {
|
||||||
step: this.step,
|
step: this.step,
|
||||||
}
|
}
|
||||||
|
@ -37,9 +41,10 @@ export class OnboardingModel {
|
||||||
console.log('hydrating onboarding', v.step)
|
console.log('hydrating onboarding', v.step)
|
||||||
this.step = v.step as OnboardingStep
|
this.step = v.step as OnboardingStep
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// if there is no valid state, we'll just reset
|
||||||
|
this.reset()
|
||||||
}
|
}
|
||||||
// if there is no valid state, we'll just reset
|
|
||||||
this.reset()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nextScreenName(currentScreenName?: OnboardingStep) {
|
nextScreenName(currentScreenName?: OnboardingStep) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue