diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-02 13:40:14 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-01-02 13:40:14 -0600 |
commit | 8cd2b4a721cd276669c401e51f1048033ed3df90 (patch) | |
tree | 7a0a3b7b972abf1ef3ab6c76cc4852a8c7680d83 /src/state/models/profile-view.ts | |
parent | 3972706c54c4e89f2167dc65b931ed05356beb9f (diff) | |
download | voidsky-8cd2b4a721cd276669c401e51f1048033ed3df90.tar.zst |
Implement account muting
Diffstat (limited to 'src/state/models/profile-view.ts')
-rw-r--r-- | src/state/models/profile-view.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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 // = |