about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Navigation.tsx4
1 files changed, 3 insertions, 1 deletions
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
+    }
   }
 }