Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: remove AddReminder from stack on navigation away to prevent stale form state

kashaf-ansari-dev57113e089641
diff --git a/apps/mobile/app/screens/add-reminder/index.tsx b/apps/mobile/app/screens/add-reminder/index.tsx
index e6cc813fa..4315c047e 100644
--- a/apps/mobile/app/screens/add-reminder/index.tsx
+++ b/apps/mobile/app/screens/add-reminder/index.tsx
@@ -288,7 +288,7 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) {
Notifications.scheduleNotification(_reminder as Reminder);
Navigation.queueRoutesForUpdate();
useRelationStore.getState().update();
- Navigation.goBack();
+ handleBackNavigation();
} catch (e) {
ToastManager.error(e as Error, undefined);
}
diff --git a/apps/mobile/app/services/navigation.ts b/apps/mobile/app/services/navigation.ts
index f3b4114d0..4bcc58eb9 100755
--- a/apps/mobile/app/services/navigation.ts
+++ b/apps/mobile/app/services/navigation.ts
@@ -177,9 +177,11 @@ function resetRootState(
if (state.routes.length < 2) return;
- const routes = state.routes.filter(
+ let routes = state.routes.filter(
(route) =>
- (route.name !== "Auth" && route.name !== "Welcome") ||
+ (route.name !== "Auth" &&
+ route.name !== "Welcome" &&
+ route.name !== "AddReminder") ||
route.key === focusedRoute.key
);