about summary refs log tree commit diff
path: root/src/lib/hooks/useIntentHandler.ts
diff options
context:
space:
mode:
authorMinseo Lee <itoupluk427@gmail.com>2024-02-29 09:51:56 +0900
committerGitHub <noreply@github.com>2024-02-29 09:51:56 +0900
commita1127bfcfc7ad080a5bd6210c6561788f1643db8 (patch)
treef2280d0308e4fc979f59f4f7abe3ef31a86390a2 /src/lib/hooks/useIntentHandler.ts
parentb723c4ca7ce22f673ea60e119da8552c452741da (diff)
parent7fd13cacfea4e9e4609ac2cfa11749544fc2f8f8 (diff)
downloadvoidsky-a1127bfcfc7ad080a5bd6210c6561788f1643db8.tar.zst
Merge branch 'main' into patch-3
Diffstat (limited to 'src/lib/hooks/useIntentHandler.ts')
-rw-r--r--src/lib/hooks/useIntentHandler.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts
index de9a96da9..d1e2de31d 100644
--- a/src/lib/hooks/useIntentHandler.ts
+++ b/src/lib/hooks/useIntentHandler.ts
@@ -3,6 +3,7 @@ import * as Linking from 'expo-linking'
 import {isNative} from 'platform/detection'
 import {useComposerControls} from 'state/shell'
 import {useSession} from 'state/session'
+import {useCloseAllActiveElements} from 'state/util'
 
 type IntentType = 'compose'
 
@@ -42,6 +43,7 @@ export function useIntentHandler() {
 }
 
 function useComposeIntent() {
+  const closeAllActiveElements = useCloseAllActiveElements()
   const {openComposer} = useComposerControls()
   const {hasSession} = useSession()
 
@@ -55,6 +57,8 @@ function useComposeIntent() {
     }) => {
       if (!hasSession) return
 
+      closeAllActiveElements()
+
       const imageUris = imageUrisStr
         ?.split(',')
         .filter(part => {
@@ -82,6 +86,6 @@ function useComposeIntent() {
         })
       }, 500)
     },
-    [openComposer, hasSession],
+    [hasSession, closeAllActiveElements, openComposer],
   )
 }