diff --git a/native/account/registration/auth-navigator.react.js b/native/account/registration/auth-navigator.react.js
--- a/native/account/registration/auth-navigator.react.js
+++ b/native/account/registration/auth-navigator.react.js
@@ -136,6 +136,11 @@
},
};
+const disableGesturesScreenOptions = {
+ headerLeft: null,
+ gestureEnabled: false,
+};
+
const cameraScreenOptions = {
headerShown: false,
};
@@ -216,6 +221,7 @@
{
+ const removeListener = props.navigation.addListener('beforeRemove', e => {
+ if (e.data.action.type !== logInActionType) {
+ e.preventDefault();
+ }
+ });
void (async () => {
try {
if (credentials.type === 'password') {
@@ -66,6 +72,7 @@
);
}
} catch (e) {
+ removeListener();
const messageForException = getMessageForException(e);
console.log(
`Backup restore error: ${messageForException ?? 'unknown error'}`,
@@ -91,6 +98,7 @@
);
}
})();
+ return removeListener;
// We want this effect to run exactly once
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);