From d3e8bd3e9a1f71b1177c0493634515379b0d1de8 Mon Sep 17 00:00:00 2001
From: Ansh <anshnanda10@gmail.com>
Date: Thu, 4 May 2023 14:18:27 -0700
Subject: [APP-547] Universal links & deeplinking (#555)

* added ios scheme and intentFilters for deep linking

* added intentFilters for android deep linking

* add .env files to .gitignore

* add autoVerify for android deep links
---
 src/Navigation.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/Navigation.tsx')

diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 9a163fc43..afc7b39b8 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -299,7 +299,9 @@ function navigate<K extends keyof AllNavigatorParams>(
 function resetToTab(tabName: 'HomeTab' | 'SearchTab' | 'NotificationsTab') {
   if (navigationRef.isReady()) {
     navigate(tabName)
-    navigationRef.dispatch(StackActions.popToTop())
+    if (navigationRef.canGoBack()) {
+      navigationRef.dispatch(StackActions.popToTop()) //we need to check .canGoBack() before calling it
+    }
   }
 }
 
-- 
cgit 1.4.1

