about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-02-28 11:35:59 -0800
committerGitHub <noreply@github.com>2024-02-28 11:35:59 -0800
commit60eb6e23d1349949d9399dc02c98fca4c4d0777a (patch)
tree6a7fde7033e18537ba2867ae50867a09fe658261 /src
parentd2c6edacb6464b52513dbe467c8b5713abd6a9fc (diff)
downloadvoidsky-60eb6e23d1349949d9399dc02c98fca4c4d0777a.tar.zst
close open dialogs when deep linking to composer (#3020)
Diffstat (limited to 'src')
-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],
   )
 }