Skip to content

Commit

Permalink
Merge pull request #680 from glouvigny/glouvigny/fix-deeplink-app-opened
Browse files Browse the repository at this point in the history
fix(mobile): handle deep links when app is already opened
  • Loading branch information
glouvigny committed Nov 29, 2018
2 parents 2bf9f83 + d4db1d7 commit 0cea71e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions client/react-native/common/components/Screens/Accounts/Current.js
Expand Up @@ -52,14 +52,24 @@ export default class Current extends PureComponent {
loading: false,
},
() => {
const {
screenProps: { deepLink },
} = this.props
this.mainNav.dispatch(NavigationActions.navigate(deepLink))
this.openDeepLink()
}
)
}

async componentDidUpdate (nextProps) {
if (nextProps.screenProps.deepLink !== this.props.screenProps.deepLink) {
this.openDeepLink()
}
}

openDeepLink = () => {
const {
screenProps: { deepLink },
} = this.props
this.mainNav.dispatch(NavigationActions.navigate(deepLink))
}

getRelayContext = async () =>
contextValue({
environment: await environment.setup({
Expand Down

0 comments on commit 0cea71e

Please sign in to comment.