about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/state')
-rw-r--r--src/state/queries/handle.ts5
-rw-r--r--src/state/queries/notifications/settings.ts2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/state/queries/handle.ts b/src/state/queries/handle.ts
index d2d79e12d..658b9e9c1 100644
--- a/src/state/queries/handle.ts
+++ b/src/state/queries/handle.ts
@@ -32,7 +32,9 @@ export function useFetchHandle() {
   )
 }
 
-export function useUpdateHandleMutation() {
+export function useUpdateHandleMutation(opts?: {
+  onSuccess?: (handle: string) => void
+}) {
   const queryClient = useQueryClient()
   const agent = useAgent()
 
@@ -41,6 +43,7 @@ export function useUpdateHandleMutation() {
       await agent.updateHandle({handle})
     },
     onSuccess(_data, variables) {
+      opts?.onSuccess?.(variables.handle)
       queryClient.invalidateQueries({
         queryKey: fetchHandleQueryKey(variables.handle),
       })
diff --git a/src/state/queries/notifications/settings.ts b/src/state/queries/notifications/settings.ts
index bfc449d17..a17fce832 100644
--- a/src/state/queries/notifications/settings.ts
+++ b/src/state/queries/notifications/settings.ts
@@ -9,7 +9,7 @@ import {invalidateCachedUnreadPage} from '#/state/queries/notifications/unread'
 import {useAgent} from '#/state/session'
 import * as Toast from '#/view/com/util/Toast'
 
-export function useNotificationsSettingsMutation() {
+export function useNotificationSettingsMutation() {
   const {_} = useLingui()
   const agent = useAgent()
   const queryClient = useQueryClient()