Await app view when handling blocks mutes for lists (#2151)
* Await app view when handling blocks mutes for lists * Do it right this timezio/stable
parent
565979e71f
commit
1b8b1b2ed1
|
@ -230,6 +230,10 @@ export function useListMuteMutation() {
|
|||
} else {
|
||||
await getAgent().unmuteModList(uri)
|
||||
}
|
||||
|
||||
await whenAppViewReady(uri, (v: AppBskyGraphGetList.Response) => {
|
||||
return Boolean(v?.data.list.viewer?.muted) === mute
|
||||
})
|
||||
},
|
||||
onSuccess(data, variables) {
|
||||
queryClient.invalidateQueries({
|
||||
|
@ -248,6 +252,12 @@ export function useListBlockMutation() {
|
|||
} else {
|
||||
await getAgent().unblockModList(uri)
|
||||
}
|
||||
|
||||
await whenAppViewReady(uri, (v: AppBskyGraphGetList.Response) => {
|
||||
return block
|
||||
? typeof v?.data.list.viewer?.blocked === 'string'
|
||||
: !v?.data.list.viewer?.blocked
|
||||
})
|
||||
},
|
||||
onSuccess(data, variables) {
|
||||
queryClient.invalidateQueries({
|
||||
|
|
Loading…
Reference in New Issue