diff options
author | Eric Bailey <git@esb.lol> | 2023-12-08 17:55:35 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 15:55:35 -0800 |
commit | 1b8b1b2ed1aac58ebb621e515eaf6b752ce709fa (patch) | |
tree | cbcf271d8bc0423943ecf24fe9c3dbef6c815bbc | |
parent | 565979e71f99064506af933493a118a2e22a044a (diff) | |
download | voidsky-1b8b1b2ed1aac58ebb621e515eaf6b752ce709fa.tar.zst |
Await app view when handling blocks mutes for lists (#2151)
* Await app view when handling blocks mutes for lists * Do it right this time
-rw-r--r-- | src/state/queries/list.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/state/queries/list.ts b/src/state/queries/list.ts index 550baecb3..013a69076 100644 --- a/src/state/queries/list.ts +++ b/src/state/queries/list.ts @@ -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({ |