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 {
|
} else {
|
||||||
await getAgent().unmuteModList(uri)
|
await getAgent().unmuteModList(uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await whenAppViewReady(uri, (v: AppBskyGraphGetList.Response) => {
|
||||||
|
return Boolean(v?.data.list.viewer?.muted) === mute
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onSuccess(data, variables) {
|
onSuccess(data, variables) {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
|
@ -248,6 +252,12 @@ export function useListBlockMutation() {
|
||||||
} else {
|
} else {
|
||||||
await getAgent().unblockModList(uri)
|
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) {
|
onSuccess(data, variables) {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
|
|
Loading…
Reference in New Issue