forked from Ivasoft/mattermost-mobile
Fix switch to channel when notification is dismissed (#6675)
This commit is contained in:
@@ -149,6 +149,12 @@ export const SCREENS_WITH_TRANSPARENT_BACKGROUND = new Set<string>([
|
||||
USER_PROFILE,
|
||||
]);
|
||||
|
||||
export const OVERLAY_SCREENS = new Set<string>([
|
||||
IN_APP_NOTIFICATION,
|
||||
GALLERY,
|
||||
SNACK_BAR,
|
||||
]);
|
||||
|
||||
export const NOT_READY = [
|
||||
CHANNEL_ADD_PEOPLE,
|
||||
CHANNEL_MENTION,
|
||||
|
||||
@@ -113,7 +113,6 @@ class PushNotifications {
|
||||
const screen = Screens.IN_APP_NOTIFICATION;
|
||||
const passProps = {
|
||||
notification,
|
||||
overlay: true,
|
||||
serverName,
|
||||
serverUrl,
|
||||
};
|
||||
|
||||
@@ -615,10 +615,7 @@ export function showOverlay(name: string, passProps = {}, options = {}) {
|
||||
component: {
|
||||
id: name,
|
||||
name,
|
||||
passProps: {
|
||||
...passProps,
|
||||
overlay: true,
|
||||
},
|
||||
passProps,
|
||||
options: merge(defaultOptions, options),
|
||||
},
|
||||
});
|
||||
|
||||
5
index.ts
5
index.ts
@@ -8,6 +8,7 @@ import 'react-native-gesture-handler';
|
||||
import {ComponentDidAppearEvent, ComponentDidDisappearEvent, ModalDismissedEvent, Navigation, ScreenPoppedEvent} from 'react-native-navigation';
|
||||
|
||||
import {Events, Screens} from './app/constants';
|
||||
import {OVERLAY_SCREENS} from './app/constants/screens';
|
||||
import DatabaseManager from './app/database/manager';
|
||||
import {getAllServerCredentials} from './app/init/credentials';
|
||||
import {initialLaunch} from './app/init/launch';
|
||||
@@ -98,8 +99,8 @@ function screenWillAppear({componentId}: ComponentDidAppearEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
function screenDidAppearListener({componentId, passProps, componentType}: ComponentDidAppearEvent) {
|
||||
if (!(passProps as any)?.overlay && componentType === 'Component') {
|
||||
function screenDidAppearListener({componentId, componentType}: ComponentDidAppearEvent) {
|
||||
if (!OVERLAY_SCREENS.has(componentId) && componentType === 'Component') {
|
||||
NavigationStore.addNavigationComponentId(componentId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user