From 99e4dfcce0aaa476db33f927b5c510cbeea2bc47 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 26 May 2020 17:02:39 -0300 Subject: [PATCH] in-app notification --- app/notifications/inApp/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/notifications/inApp/index.js b/app/notifications/inApp/index.js index 73f8d7c17..aa85e8402 100644 --- a/app/notifications/inApp/index.js +++ b/app/notifications/inApp/index.js @@ -107,7 +107,7 @@ class NotificationBadge extends React.Component { const { notification: { payload }, route } = this.props; const navState = this.getNavState(route.state); if (payload.rid) { - if (navState && navState.routeName === 'RoomView' && navState.params && navState.params.rid === payload.rid) { + if (navState && navState.name === 'RoomView' && navState.params && navState.params?.rid === payload.rid) { return; } this.show(); @@ -151,11 +151,12 @@ class NotificationBadge extends React.Component { } } - getNavState = (routes) => { - if (!routes.routes) { - return routes; + getNavState = (state) => { + const value = state.routes[state.index]; + if (value.state) { + return this.getNavState(value.state); } - return this.getNavState(routes.routes[routes.index]); + return value; } goToRoom = async() => {