diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-07 15:35:51 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-07 15:35:51 -0600 |
commit | d228a5f4f5d118f30129f3bafd676bfe0e80bf38 (patch) | |
tree | e292e9d3b1f7a027298308ef583a7d3b90b59157 /src/state/models/session.ts | |
parent | b4097e25d67739c0ab6bc5b5f6ce8ee062796458 (diff) | |
download | voidsky-d228a5f4f5d118f30129f3bafd676bfe0e80bf38.tar.zst |
Add onboarding (WIP)
Diffstat (limited to 'src/state/models/session.ts')
-rw-r--r-- | src/state/models/session.ts | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/state/models/session.ts b/src/state/models/session.ts index e29960954..e10a08e86 100644 --- a/src/state/models/session.ts +++ b/src/state/models/session.ts @@ -15,17 +15,8 @@ interface SessionData { did: string } -export enum OnboardingStage { - Init = 'init', -} - -interface OnboardingState { - stage: OnboardingStage -} - export class SessionModel { data: SessionData | null = null - onboardingState: OnboardingState | null = null constructor(public rootStore: RootStoreModel) { makeAutoObservable(this, { @@ -42,7 +33,6 @@ export class SessionModel { serialize(): unknown { return { data: this.data, - onboardingState: this.onboardingState, } } @@ -87,18 +77,6 @@ export class SessionModel { this.data = data } } - if ( - this.data && - hasProp(v, 'onboardingState') && - isObj(v.onboardingState) - ) { - if ( - hasProp(v.onboardingState, 'stage') && - typeof v.onboardingState === 'string' - ) { - this.onboardingState = v.onboardingState - } - } } } @@ -212,7 +190,7 @@ export class SessionModel { handle: res.data.handle, did: res.data.did, }) - this.setOnboardingStage(OnboardingStage.Init) + this.rootStore.onboard.start() this.configureApi() this.rootStore.me.load().catch(e => { console.error('Failed to fetch local user information', e) @@ -228,12 +206,4 @@ export class SessionModel { } this.rootStore.clearAll() } - - setOnboardingStage(stage: OnboardingStage | null) { - if (stage === null) { - this.onboardingState = null - } else { - this.onboardingState = {stage} - } - } } |