in-app notification
This commit is contained in:
parent
3347a6755a
commit
99e4dfcce0
|
@ -107,7 +107,7 @@ class NotificationBadge extends React.Component {
|
||||||
const { notification: { payload }, route } = this.props;
|
const { notification: { payload }, route } = this.props;
|
||||||
const navState = this.getNavState(route.state);
|
const navState = this.getNavState(route.state);
|
||||||
if (payload.rid) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
this.show();
|
this.show();
|
||||||
|
@ -151,11 +151,12 @@ class NotificationBadge extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNavState = (routes) => {
|
getNavState = (state) => {
|
||||||
if (!routes.routes) {
|
const value = state.routes[state.index];
|
||||||
return routes;
|
if (value.state) {
|
||||||
|
return this.getNavState(value.state);
|
||||||
}
|
}
|
||||||
return this.getNavState(routes.routes[routes.index]);
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
goToRoom = async() => {
|
goToRoom = async() => {
|
||||||
|
|
Loading…
Reference in New Issue