about summary refs log tree commit diff
path: root/src/view/screens/Profile.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-14 10:41:55 -0800
committerGitHub <noreply@github.com>2023-11-14 10:41:55 -0800
commit0a26e78dcbbf48dad5daae73b210e236d706b22c (patch)
treec06c737ed49e8294bf5cbec1a75c36b591cb6669 /src/view/screens/Profile.tsx
parentc687172de96bd6aa85d3aa025c2e0f024640f345 (diff)
downloadvoidsky-0a26e78dcbbf48dad5daae73b210e236d706b22c.tar.zst
Composer update (react-query refactor) (#1899)
* Move composer state to a context

* Rework composer to use RQ

---------

Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/screens/Profile.tsx')
-rw-r--r--src/view/screens/Profile.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx
index 724c47c95..17ea4498c 100644
--- a/src/view/screens/Profile.tsx
+++ b/src/view/screens/Profile.tsx
@@ -36,6 +36,7 @@ import {useSetDrawerSwipeDisabled, useSetMinimalShellMode} from '#/state/shell'
 import {cleanError} from '#/lib/strings/errors'
 import {LoadLatestBtn} from '../com/util/load-latest/LoadLatestBtn'
 import {useQueryClient} from '@tanstack/react-query'
+import {useComposerControls} from '#/state/shell/composer'
 
 type Props = NativeStackScreenProps<CommonNavigatorParams, 'Profile'>
 export const ProfileScreen = withAuthRequired(function ProfileScreenImpl({
@@ -128,6 +129,7 @@ function ProfileScreenLoaded({
   const store = useStores()
   const {currentAccount} = useSession()
   const setMinimalShellMode = useSetMinimalShellMode()
+  const {openComposer} = useComposerControls()
   const {screen, track} = useAnalytics()
   const [currentPage, setCurrentPage] = React.useState(0)
   const {_} = useLingui()
@@ -193,8 +195,8 @@ function ProfileScreenLoaded({
       profile.handle === 'handle.invalid'
         ? undefined
         : profile.handle
-    store.shell.openComposer({mention})
-  }, [store, currentAccount, track, profile])
+    openComposer({mention})
+  }, [openComposer, currentAccount, track, profile])
 
   const onPageSelected = React.useCallback(
     i => {