diff --git a/src/screens/HomeScreen.js b/src/screens/HomeScreen.js index 13e3013..9038c65 100644 --- a/src/screens/HomeScreen.js +++ b/src/screens/HomeScreen.js @@ -77,7 +77,13 @@ class HomeScreen extends React.Component { headerRight: this.getHeaderButton, }); } - // TODO if already on home screen + // Handle link open when home is focused + this.props.navigation.addListener('state', this.handleNavigationParams); + // handle link open when home is not focused or created + this.handleNavigationParams(); + }; + + handleNavigationParams = () => { if (this.props.route.params !== undefined) { if (this.props.route.params.shouldOpen !== undefined && this.props.route.params.shouldOpen) { this.props.navigation.navigate(this.props.route.params.nextScreen, this.props.route.params.data);