[FIX] Endless "connecting" on notification tap (#1121)

This commit is contained in:
Diego Mello 2019-08-09 14:03:15 -03:00 committed by GitHub
parent 2d3894ccb2
commit b8d9848e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,7 @@
import NotificationsIOS from 'react-native-notifications';
import reduxStore from '../../lib/createStore';
class PushNotification {
constructor() {
this.onRegister = null;
@ -11,7 +13,10 @@ class PushNotification {
});
NotificationsIOS.addEventListener('notificationOpened', (notification, completion) => {
this.onNotification(notification);
const { background } = reduxStore.getState().app;
if (background) {
this.onNotification(notification);
}
completion();
});