Await app view when handling blocks mutes for lists (#2151)

* Await app view when handling blocks mutes for lists

* Do it right this time
This commit is contained in:
Eric Bailey
2023-12-08 17:55:35 -06:00
committed by GitHub
parent 565979e71f
commit 1b8b1b2ed1
+10
View File
@@ -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({