Skip to content

Commit dff7301

Browse files
committed
fix: navigate to Home after login instead of goBack
1 parent 2ca4d84 commit dff7301

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mobile/src/screens/LoginScreen.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function LoginScreen({ navigation }) {
3838
picture: userInfo.data.user.photo,
3939
};
4040
await login(user);
41-
navigation.goBack();
41+
navigation.replace('Home');
4242
} catch (error) {
4343
if (error.code === statusCodes.SIGN_IN_CANCELLED) return;
4444
if (error.code === statusCodes.IN_PROGRESS) return;
@@ -54,14 +54,14 @@ export default function LoginScreen({ navigation }) {
5454
if (form.password.length < 6) { Alert.alert('Error', 'Password must be at least 6 characters'); return; }
5555
const user = { name: form.name, email: form.email, picture: null };
5656
await login(user);
57-
navigation.goBack();
57+
navigation.replace('Home');
5858
} else {
5959
const saved = await AsyncStorage.getItem('zappify_user');
6060
if (saved) {
6161
const u = JSON.parse(saved);
6262
if (u.email === form.email) {
6363
await login(u);
64-
navigation.goBack();
64+
navigation.replace('Home');
6565
} else {
6666
Alert.alert('Error', 'Account not found. Please sign up first.');
6767
}

0 commit comments

Comments
 (0)