Clear all state on signout
This commit is contained in:
parent
e3e4c4366c
commit
11f213ad09
6 changed files with 32 additions and 9 deletions
|
|
@ -11,6 +11,13 @@ export class MeModel {
|
|||
makeAutoObservable(this, {rootStore: false}, {autoBind: true})
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.did = undefined
|
||||
this.name = undefined
|
||||
this.displayName = undefined
|
||||
this.description = undefined
|
||||
}
|
||||
|
||||
async load() {
|
||||
const sess = this.rootStore.session
|
||||
if (sess.isAuthed && sess.data) {
|
||||
|
|
@ -29,10 +36,7 @@ export class MeModel {
|
|||
}
|
||||
})
|
||||
} else {
|
||||
this.did = undefined
|
||||
this.name = undefined
|
||||
this.displayName = undefined
|
||||
this.description = undefined
|
||||
this.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue