do not dispatch navigation actions when opening the app from a push notification (#3184)

This commit is contained in:
Mattermost Build 2019-08-24 04:20:22 +02:00 committed by Elias Nahum
parent 86d590fd7f
commit dbc9ecb201

View file

@ -43,9 +43,13 @@ class PushNotificationUtils {
};
loadFromNotification = async (notification) => {
// Set appStartedFromPushNotification to avoid channel screen to call selectInitialChannel
EphemeralStore.appStartedFromPushNotification = true;
await this.store.dispatch(loadFromPushNotification(notification, true));
if (!EphemeralStore.appStartedFromPushNotification) {
// if we have a componentId means that the app is already initialized
const componentId = EphemeralStore.getNavigationTopComponentId();
if (componentId) {
EventEmitter.emit('close_channel_drawer');
EventEmitter.emit('close_settings_sidebar');
@ -190,11 +194,11 @@ class PushNotificationUtils {
};
unsubscribeFromStore = this.store.subscribe(waitForHydration);
}
};
getNotification = () => {
return PushNotifications.getNotification();
}
};
}
export default new PushNotificationUtils();