Add a timeout to avoid race conditions when opening the app from a push notification (#2015)

This commit is contained in:
Elias Nahum 2018-08-17 08:55:35 -03:00 committed by GitHub
parent 19fcb72315
commit 830132bc38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,7 +87,9 @@ const onPushNotification = async (deviceNotification) => {
} else if (userInteraction && !notification.localNotification) {
EventEmitter.emit('close_channel_drawer');
if (getState().views.root.hydrationComplete) {
loadFromNotification(notification);
setTimeout(() => {
loadFromNotification(notification);
}, 0);
} else {
const waitForHydration = () => {
if (getState().views.root.hydrationComplete && !stopLoadingNotification) {