Skip to content

Commit

Permalink
add calls notification type; keep message test for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
cpoile committed Nov 7, 2023
1 parent 872f81e commit 1d704ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/constants/push_notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const NOTIFICATION_TYPE = {
CLEAR: 'clear',
MESSAGE: 'message',
SESSION: 'session',
CALLS: 'calls',
};

export default {
Expand Down
3 changes: 2 additions & 1 deletion app/init/push_notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {updateThread} from '@actions/local/thread';
import {backgroundNotification, openNotification} from '@actions/remote/notifications';
import {isCallsStartedMessage} from '@calls/utils';
import {Device, Events, Navigation, PushNotification, Screens} from '@constants';
import {NOTIFICATION_TYPE} from '@constants/push_notification';
import DatabaseManager from '@database/manager';
import {DEFAULT_LOCALE, getLocalizedMessage, t} from '@i18n';
import NativeNotifications from '@notifications';
Expand Down Expand Up @@ -109,7 +110,7 @@ class PushNotifications {
const {payload} = notification;

// Do not show overlay if this is a call-started message (the call_notification will alert the user)
if (isCallsStartedMessage(notification.payload?.message)) {
if (notification.type === NOTIFICATION_TYPE.CALLS || isCallsStartedMessage(notification.payload?.message)) {
return;
}

Expand Down

0 comments on commit 1d704ed

Please sign in to comment.