From 3fe6be4238349c58de04eefc827501752acca1a8 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Thu, 9 Apr 2020 00:43:43 +0200 Subject: [PATCH] Allow going back to last screen after login --- App.js | 2 +- src/components/Custom/ErrorView.js | 7 ++++- src/components/Lists/WebSectionList.js | 6 ++--- src/navigation/MainTabNavigator.js | 4 +-- src/screens/Amicale/LoginScreen.js | 37 +++++++++++++++++++++----- src/screens/HomeScreen.js | 22 +++++++-------- src/utils/URLHandler.js | 4 +-- 7 files changed, 53 insertions(+), 29 deletions(-) diff --git a/App.js b/App.js index 62a3058..c56b066 100644 --- a/App.js +++ b/App.js @@ -73,7 +73,7 @@ export default class App extends React.Component { // Navigate to nested navigator and pass data to the index screen this.navigatorRef.current.navigate('home', { screen: 'index', - params: {nextScreen: route, data: data, shouldOpen: true} + params: {nextScreen: route, data: data} }); }; diff --git a/src/components/Custom/ErrorView.js b/src/components/Custom/ErrorView.js index 4d302c2..8b1c117 100644 --- a/src/components/Custom/ErrorView.js +++ b/src/components/Custom/ErrorView.js @@ -9,6 +9,7 @@ import {ERROR_TYPE} from "../../managers/ConnectionManager"; type Props = { navigation: Object, + route: Object, errorCode: number, onRefresh: Function, } @@ -85,7 +86,11 @@ class ErrorView extends React.PureComponent { ; } - goToLogin = () => this.props.navigation.navigate("login"); + goToLogin = () => this.props.navigation.navigate("login", + { + screen: 'index', + params: {nextScreen: this.props.route.name} + }); getLoginButton() { return