Skip to content

Commit

Permalink
DMAPP-135: Integrate chat notification
Browse files Browse the repository at this point in the history
- Fixed navigation issue triggered on notification press.
  • Loading branch information
meKushdeepSingh committed Dec 24, 2024
1 parent e38d8ae commit dab503d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/contexts/NotificationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,17 @@ export const NotificationContextProvider = ({
threadhash: parsedDetails?.info?.threadhash,
});
if (singleChatParams) {
if (getCurrentRouteName() === GLOBALS.SCREENS.SINGLE_CHAT) {
// If Single chat screen is already active then update params data
if (
getCurrentRouteName() === GLOBALS.SCREENS.SINGLE_CHAT &&
getCurrentRouteParams()?.chatId !== parsedDetails?.info?.chatId
) {
// If Single/Group chat screen is already active with different chatId then update params data
replaceRoute(GLOBALS.SCREENS.SINGLE_CHAT, singleChatParams);
setTempNotificationData(null);
} else {
} else if (
getCurrentRouteName() !== GLOBALS.SCREENS.SINGLE_CHAT
) {
// Navigate to Single/Group chat screen
navigate(GLOBALS.SCREENS.SINGLE_CHAT, singleChatParams);
setTempNotificationData(null);
}
}
} else if (
Expand All @@ -339,6 +342,7 @@ export const NotificationContextProvider = ({
pkey,
});
}
setTempNotificationData(null);
} catch (error) {
console.log('Notification Route ERROR', error);
}
Expand Down

0 comments on commit dab503d

Please sign in to comment.