|
@@ -50,11 +50,27 @@ class LoginScreen extends React.Component<Props, State> {
|
50
|
50
|
onPasswordChange: Function;
|
51
|
51
|
passwordInputRef: Object;
|
52
|
52
|
|
|
53
|
+ nextScreen: string | null;
|
53
|
54
|
|
54
|
55
|
constructor(props) {
|
55
|
56
|
super(props);
|
56
|
57
|
this.onEmailChange = this.onInputChange.bind(this, true);
|
57
|
58
|
this.onPasswordChange = this.onInputChange.bind(this, false);
|
|
59
|
+ this.props.navigation.addListener('focus', this.onScreenFocus);
|
|
60
|
+ }
|
|
61
|
+
|
|
62
|
+ onScreenFocus = () => {
|
|
63
|
+ this.handleNavigationParams();
|
|
64
|
+ };
|
|
65
|
+
|
|
66
|
+ handleNavigationParams () {
|
|
67
|
+ if (this.props.route.params != null) {
|
|
68
|
+ if (this.props.route.params.nextScreen != null)
|
|
69
|
+ this.nextScreen = this.props.route.params.nextScreen;
|
|
70
|
+ else
|
|
71
|
+ this.nextScreen = null;
|
|
72
|
+ }
|
|
73
|
+ console.log(this.nextScreen);
|
58
|
74
|
}
|
59
|
75
|
|
60
|
76
|
showErrorDialog = (error: number) =>
|
|
@@ -65,7 +81,12 @@ class LoginScreen extends React.Component<Props, State> {
|
65
|
81
|
|
66
|
82
|
hideErrorDialog = () => this.setState({dialogVisible: false});
|
67
|
83
|
|
68
|
|
- handleSuccess = () => this.props.navigation.goBack();
|
|
84
|
+ handleSuccess = () => {
|
|
85
|
+ if (this.nextScreen == null)
|
|
86
|
+ this.props.navigation.goBack();
|
|
87
|
+ else
|
|
88
|
+ this.props.navigation.replace(this.nextScreen);
|
|
89
|
+ };
|
69
|
90
|
|
70
|
91
|
onResetPasswordClick = () => Linking.openURL(RESET_PASSWORD_PATH);
|
71
|
92
|
|