about summary refs log tree commit diff
path: root/src/state/queries/profile.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-27 22:50:32 +0100
committerGitHub <noreply@github.com>2024-09-28 00:50:32 +0300
commit4b5d6e6efb09a714d82e2093dec39c85400a2de6 (patch)
tree981d0e08b30549234e02be49dbb190e55740556f /src/state/queries/profile.ts
parentf68b15219fd02e23d965015201400138ed69d59d (diff)
downloadvoidsky-4b5d6e6efb09a714d82e2093dec39c85400a2de6.tar.zst
Pinned posts (#5055)
* add to dropdown menu

* use normal profile mutation hook

* add pin as reason

* request pins

* shadow update

* rm logs

* get prev pinned from getProfile

* fix toasts

* invalidate after appview ready

* don't mutate params

* rm log

* use checkCommited rather than manual whenAppViewReady

* move to mutation

* even more optimistic optimistic update

* allow pins in `posts_and_author_threads`

* update @atproto/api

* add reasonPin type

* fix strange type error in unrelated query

* another missing type
Diffstat (limited to 'src/state/queries/profile.ts')
-rw-r--r--src/state/queries/profile.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts
index 78a142eea..3059d9efe 100644
--- a/src/state/queries/profile.ts
+++ b/src/state/queries/profile.ts
@@ -159,6 +159,9 @@ export function useProfileUpdateMutation() {
         } else {
           existing.displayName = updates.displayName
           existing.description = updates.description
+          if ('pinnedPost' in updates) {
+            existing.pinnedPost = updates.pinnedPost
+          }
         }
         if (newUserAvatarPromise) {
           const res = await newUserAvatarPromise