|
@@ -77,7 +77,13 @@ class HomeScreen extends React.Component<Props> {
|
77
|
77
|
headerRight: this.getHeaderButton,
|
78
|
78
|
});
|
79
|
79
|
}
|
80
|
|
- // TODO if already on home screen
|
|
80
|
+ // Handle link open when home is focused
|
|
81
|
+ this.props.navigation.addListener('state', this.handleNavigationParams);
|
|
82
|
+ // handle link open when home is not focused or created
|
|
83
|
+ this.handleNavigationParams();
|
|
84
|
+ };
|
|
85
|
+
|
|
86
|
+ handleNavigationParams = () => {
|
81
|
87
|
if (this.props.route.params !== undefined) {
|
82
|
88
|
if (this.props.route.params.shouldOpen !== undefined && this.props.route.params.shouldOpen) {
|
83
|
89
|
this.props.navigation.navigate(this.props.route.params.nextScreen, this.props.route.params.data);
|