about summary refs log tree commit diff
path: root/src/state/models/profile-view.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/profile-view.ts')
-rw-r--r--src/state/models/profile-view.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts
index 836cb3f75..bca4c6158 100644
--- a/src/state/models/profile-view.ts
+++ b/src/state/models/profile-view.ts
@@ -2,6 +2,14 @@ import {makeAutoObservable} from 'mobx'
 import {bsky} from '@adxp/mock-api'
 import {RootStoreModel} from './root-store'
 
+export class ProfileViewMyStateModel {
+  hasFollowed: boolean = false
+
+  constructor() {
+    makeAutoObservable(this)
+  }
+}
+
 export class ProfileViewModel implements bsky.ProfileView.Response {
   // state
   isLoading = false
@@ -19,6 +27,7 @@ export class ProfileViewModel implements bsky.ProfileView.Response {
   followsCount: number = 0
   postsCount: number = 0
   badges: bsky.ProfileView.Badge[] = []
+  myState = new ProfileViewMyStateModel()
 
   constructor(
     public rootStore: RootStoreModel,
@@ -101,5 +110,8 @@ export class ProfileViewModel implements bsky.ProfileView.Response {
     this.followsCount = res.followsCount
     this.postsCount = res.postsCount
     this.badges = res.badges
+    if (res.myState) {
+      Object.assign(this.myState, res.myState)
+    }
   }
 }