Clear all state on signout

This commit is contained in:
Paul Frazee 2022-09-29 13:55:07 -05:00
parent e3e4c4366c
commit 11f213ad09
6 changed files with 32 additions and 9 deletions

View file

@ -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()
}
}
}