From 830132bc38034841d860dbd2a6f7f1ce9c6edc2a Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 17 Aug 2018 08:55:35 -0300 Subject: [PATCH] Add a timeout to avoid race conditions when opening the app from a push notification (#2015) --- app/utils/push_notifications.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/utils/push_notifications.js b/app/utils/push_notifications.js index 6249c7509..d590e9d97 100644 --- a/app/utils/push_notifications.js +++ b/app/utils/push_notifications.js @@ -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) {