From 59d38721dfa63f80b13489d2568377b626d1a878 Mon Sep 17 00:00:00 2001 From: analuizaff Date: Tue, 6 Jul 2021 17:17:16 -0300 Subject: [PATCH] Another attempt to solve a navigation problem to 'SharingDataScreen' --- src/app/navigation/AppNavigator.js | 9 ++++----- src/app/screens/PluviometerSharingDataScreen.js | 1 - src/app/screens/RainSharingDataScreen.js | 6 ------ src/app/screens/RiverFloodSharingDataScreen.js | 1 - src/app/screens/SharingFloodZonesScreen.js | 1 - 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/app/navigation/AppNavigator.js b/src/app/navigation/AppNavigator.js index 3e858d7..75df1ff 100644 --- a/src/app/navigation/AppNavigator.js +++ b/src/app/navigation/AppNavigator.js @@ -40,13 +40,12 @@ const AppNavigator = () => ( name="SharingData" component={SharingDataOptionsNavigator} options={({ navigation }) => ({ - tabBarButton: () => ( + tabBarButton: () => ( - navigation.reset({ - index: 0, - key: "RainSharingData", - routes: [{ name: "SharingData" }], + navigation.navigate("SharingData",{ + screen:"Voltar", + initial: false, }) } /> diff --git a/src/app/screens/PluviometerSharingDataScreen.js b/src/app/screens/PluviometerSharingDataScreen.js index 3ac5f57..7481079 100644 --- a/src/app/screens/PluviometerSharingDataScreen.js +++ b/src/app/screens/PluviometerSharingDataScreen.js @@ -64,7 +64,6 @@ function PluviometerSharingDataScreen(props) { icon: "success", type: "success", }); - props.navigation.goBack(); props.navigation.navigate("Home"); }} validationSchema={validationSchema} diff --git a/src/app/screens/RainSharingDataScreen.js b/src/app/screens/RainSharingDataScreen.js index b08d0dc..2d885a1 100644 --- a/src/app/screens/RainSharingDataScreen.js +++ b/src/app/screens/RainSharingDataScreen.js @@ -41,12 +41,6 @@ function RainSharingDataScreen(props) { context.defaultLocation(); }, []); - console.log(props.route) - /*useEffect(() => { - !isFocused && - props.navigation.goBack(); - }, [isFocused])*/ - const location = context.eventCoordinates; const address = context.eventLocation; diff --git a/src/app/screens/RiverFloodSharingDataScreen.js b/src/app/screens/RiverFloodSharingDataScreen.js index 1e1b5da..5a4a69a 100644 --- a/src/app/screens/RiverFloodSharingDataScreen.js +++ b/src/app/screens/RiverFloodSharingDataScreen.js @@ -72,7 +72,6 @@ function RiverFloodSharingDataScreen(props) { icon: "success", type: "success", }); - props.navigation.goBack(); props.navigation.navigate("Home"); }} validationSchema={validationSchema} diff --git a/src/app/screens/SharingFloodZonesScreen.js b/src/app/screens/SharingFloodZonesScreen.js index 81f1ac3..edb7d0c 100644 --- a/src/app/screens/SharingFloodZonesScreen.js +++ b/src/app/screens/SharingFloodZonesScreen.js @@ -68,7 +68,6 @@ function SharingFloodZonesScreen(props) { icon: "success", type: "success", }); - props.navigation.goBack(); props.navigation.navigate("Home"); }} validationSchema={validationSchema}