MM-14470 Deep links launch when app is not currently open (#3802)

Previously, deep links would only work when the app was already open/previously launched.

Now, invoking a deep link launches the app if not already open, and opens the deep link destination.
This commit is contained in:
Amit Uttam 2020-01-15 13:54:18 -03:00 committed by GitHub
parent 92033f42ec
commit f6ee6b767e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,15 @@ export default class PostList extends PureComponent {
}
componentDidMount() {
const {actions, deepLinkURL} = this.props;
EventEmitter.on('scroll-to-bottom', this.handleSetScrollToBottom);
// Invoked when hitting a deep link and app is not already running.
if (deepLinkURL) {
this.handleDeepLink(deepLinkURL);
actions.setDeepLinkURL('');
}
}
componentDidUpdate(prevProps) {
@ -108,6 +116,7 @@ export default class PostList extends PureComponent {
this.resetPostList();
}
// Invoked when hitting a deep link and app is already running.
if (deepLinkURL && deepLinkURL !== prevProps.deepLinkURL) {
this.handleDeepLink(deepLinkURL);
actions.setDeepLinkURL('');