Implement account muting
This commit is contained in:
parent
3972706c54
commit
8cd2b4a721
12 changed files with 101 additions and 15 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
// =
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue