about summary refs log tree commit diff
path: root/src/state/queries/useCurrentAccountProfile.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/useCurrentAccountProfile.tsx')
-rw-r--r--src/state/queries/useCurrentAccountProfile.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state/queries/useCurrentAccountProfile.tsx b/src/state/queries/useCurrentAccountProfile.tsx
new file mode 100644
index 000000000..d1f562efc
--- /dev/null
+++ b/src/state/queries/useCurrentAccountProfile.tsx
@@ -0,0 +1,9 @@
+import {useMaybeProfileShadow} from '#/state/cache/profile-shadow'
+import {useProfileQuery} from '#/state/queries/profile'
+import {useSession} from '#/state/session'
+
+export function useCurrentAccountProfile() {
+  const {currentAccount} = useSession()
+  const {data: profile} = useProfileQuery({did: currentAccount?.did})
+  return useMaybeProfileShadow(profile)
+}