about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-12-08 17:55:35 -0600
committerGitHub <noreply@github.com>2023-12-08 15:55:35 -0800
commit1b8b1b2ed1aac58ebb621e515eaf6b752ce709fa (patch)
treecbcf271d8bc0423943ecf24fe9c3dbef6c815bbc /src
parent565979e71f99064506af933493a118a2e22a044a (diff)
downloadvoidsky-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
Diffstat (limited to 'src')
-rw-r--r--src/state/queries/list.ts10
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({