diff --git a/src/screens/Amicale/LoginScreen.js b/src/screens/Amicale/LoginScreen.js index efe038d..3b83163 100644 --- a/src/screens/Amicale/LoginScreen.js +++ b/src/screens/Amicale/LoginScreen.js @@ -6,15 +6,16 @@ import {Avatar, Button, Card, HelperText, Paragraph, TextInput, withTheme} from import ConnectionManager from "../../managers/ConnectionManager"; import i18n from 'i18n-js'; import ErrorDialog from "../../components/Dialogs/ErrorDialog"; -import {CommonActions} from "@react-navigation/native"; import {withCollapsible} from "../../utils/withCollapsible"; import {Collapsible} from "react-navigation-collapsible"; import CustomTabBar from "../../components/Tabbar/CustomTabBar"; +import type {CustomTheme} from "../../managers/ThemeManager"; type Props = { navigation: Object, route: Object, collapsibleStack: Collapsible, + theme: CustomTheme } type State = { @@ -45,32 +46,17 @@ class LoginScreen extends React.Component { dialogError: 0, }; - colors: Object; - onEmailChange: Function; onPasswordChange: Function; passwordInputRef: Object; - nextScreen: string; constructor(props) { super(props); this.onEmailChange = this.onInputChange.bind(this, true); this.onPasswordChange = this.onInputChange.bind(this, false); - - this.colors = props.theme.colors; - - this.props.navigation.addListener('focus', this.onScreenFocus); } - onScreenFocus = () => { - if (this.props.route.params !== undefined && this.props.route.params.nextScreen !== undefined) { - this.nextScreen = this.props.route.params.nextScreen; - this.props.navigation.dispatch(CommonActions.setParams({nextScreen: 'profile'})); - } else - this.nextScreen = 'profile'; - }; - showErrorDialog = (error: number) => this.setState({ dialogVisible: true, @@ -79,7 +65,7 @@ class LoginScreen extends React.Component { hideErrorDialog = () => this.setState({dialogVisible: false}); - handleSuccess = () => this.props.navigation.replace(this.nextScreen); + handleSuccess = () => this.props.navigation.goBack(); onResetPasswordClick = () => this.props.navigation.navigate('amicale-website', { screen: 'amicale-website', @@ -239,7 +225,7 @@ class LoginScreen extends React.Component { left={(props) => } />