about summary refs log tree commit diff
path: root/src/state/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models')
-rw-r--r--src/state/models/feed-view.ts1
-rw-r--r--src/state/models/profile-view.ts13
2 files changed, 13 insertions, 1 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts
index 2c205d7c0..b5a3b29d7 100644
--- a/src/state/models/feed-view.ts
+++ b/src/state/models/feed-view.ts
@@ -593,6 +593,5 @@ function ts(item: FeedViewPost | FeedItemModel): string {
     // @ts-ignore need better type checks
     return item.reason.indexedAt
   }
-  console.log(item)
   return item.post.indexedAt
 }
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts
index ce70867ae..2a69a1345 100644
--- a/src/state/models/profile-view.ts
+++ b/src/state/models/profile-view.ts
@@ -18,6 +18,7 @@ export const ACTOR_TYPE_SCENE = 'app.bsky.system.actorScene'
 export class ProfileViewMyStateModel {
   follow?: string
   member?: string
+  muted?: boolean
 
   constructor() {
     makeAutoObservable(this)
@@ -156,6 +157,18 @@ export class ProfileViewModel {
     await this.refresh()
   }
 
+  async muteAccount() {
+    await this.rootStore.api.app.bsky.graph.mute({user: this.did})
+    this.myState.muted = true
+    await this.refresh()
+  }
+
+  async unmuteAccount() {
+    await this.rootStore.api.app.bsky.graph.unmute({user: this.did})
+    this.myState.muted = false
+    await this.refresh()
+  }
+
   // state transitions
   // =