about summary refs log tree commit diff
path: root/src/state/models/me.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/me.ts')
-rw-r--r--src/state/models/me.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/state/models/me.ts b/src/state/models/me.ts
index 17a372381..0a3627217 100644
--- a/src/state/models/me.ts
+++ b/src/state/models/me.ts
@@ -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()
     }
   }
 }