about summary refs log tree commit diff
path: root/src/Navigation.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-02-27 10:35:38 -0800
committerGitHub <noreply@github.com>2024-02-27 10:35:38 -0800
commit2a04546c7305b9bf03ea6cd26ce728ed773e2673 (patch)
treeac52dcc02d170bdc9970514387352ab8e08b2bc1 /src/Navigation.tsx
parentc8d02a791a84a243b290b3a1479aa6ac097a51fa (diff)
downloadvoidsky-2a04546c7305b9bf03ea6cd26ce728ed773e2673.tar.zst
Intent handler (#2992)
* Handle URL params

* Add resources

* Add other params

* refactor for scope

* modify the pr to support intents rather than utm

remove linebreak

remove linebreak

handle web

adjust path check to work on web

add a short delay for opening the composer

setup compose intent, move to `intents` directory

fix intent logic

ignore incoming intents in the navigation router

* refactor

---------

Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/Navigation.tsx')
-rw-r--r--src/Navigation.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index dfbe816f4..0aeeeb6ad 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -460,7 +460,8 @@ const FlatNavigator = () => {
  */
 
 const LINKING = {
-  prefixes: ['bsky://', 'https://bsky.app'],
+  // TODO figure out what we are going to use
+  prefixes: ['bsky://', 'bluesky://', 'https://bsky.app'],
 
   getPathFromState(state: State) {
     // find the current node in the navigation tree
@@ -478,6 +479,11 @@ const LINKING = {
   },
 
   getStateFromPath(path: string) {
+    // Any time we receive a url that starts with `intent/` we want to ignore it here. It will be handled in the
+    // intent handler hook. We should check for the trailing slash, because if there isn't one then it isn't a valid
+    // intent
+    if (path.includes('intent/')) return
+
     const [name, params] = router.matchPath(path)
     if (isNative) {
       if (name === 'Search') {