diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-09-29 13:55:07 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-09-29 13:55:07 -0500 |
commit | 11f213ad097f927795a48537876dfa6d62247ead (patch) | |
tree | b5eb6623a44a526aa003ad749bfaabe320a90d0f /src/state/models/session.ts | |
parent | e3e4c4366cf293eeef173eff859eea775141baa1 (diff) | |
download | voidsky-11f213ad097f927795a48537876dfa6d62247ead.tar.zst |
Clear all state on signout
Diffstat (limited to 'src/state/models/session.ts')
-rw-r--r-- | src/state/models/session.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/models/session.ts b/src/state/models/session.ts index ec3a7fc03..ced7ceeb0 100644 --- a/src/state/models/session.ts +++ b/src/state/models/session.ts @@ -124,6 +124,9 @@ export class SessionModel { try { const sess = await this.rootStore.api.todo.adx.getSession({}) if (sess.success && this.data && this.data.userdid === sess.data.did) { + this.rootStore.me.load().catch(e => { + console.error('Failed to fetch local user information', e) + }) return // success } } catch (e: any) {} @@ -156,6 +159,9 @@ export class SessionModel { userdid: res.data.did, }) this.configureApi() + this.rootStore.me.load().catch(e => { + console.error('Failed to fetch local user information', e) + }) } } @@ -186,6 +192,9 @@ export class SessionModel { }) this.setOnboardingStage(OnboardingStage.Init) this.configureApi() + this.rootStore.me.load().catch(e => { + console.error('Failed to fetch local user information', e) + }) } } @@ -195,7 +204,7 @@ export class SessionModel { console.error('(Minor issue) Failed to delete session on the server', e) }) } - this.clear() + this.rootStore.clearAll() } setOnboardingStage(stage: OnboardingStage | null) { |