Skip to content

Commit

Permalink
Fix issue message unread from notification center panel
Browse files Browse the repository at this point in the history
  • Loading branch information
wildan-m committed Apr 25, 2024
1 parent 9a727de commit 6023e76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ const ROUTES = {
REPORT: 'r',
REPORT_WITH_ID: {
route: 'r/:reportID?/:reportActionID?',
getRoute: (reportID: string, reportActionID?: string) => (reportActionID ? (`r/${reportID}/${reportActionID}` as const) : (`r/${reportID}` as const)),
getRoute: (reportID: string, reportActionID?: string, referrer?: string) => {
let route = reportActionID ? `r/${reportID}/${reportActionID}` : `r/${reportID}`;
if (referrer) {
route += `?referrer=${referrer}`;
}
return route;
},
},
REPORT_AVATAR: {
route: 'r/:reportID/avatar',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@ function showReportActionNotification(reportID: string, reportAction: ReportActi
if (!reportBelongsToWorkspace) {
Navigation.navigateWithSwitchPolicyID({route: ROUTES.HOME});
}
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID, undefined, 'notification'));
});

if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE) {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ function ReportActionsList({
if (!userActiveSince.current || report.reportID !== prevReportID) {
return;
}

if (ReportUtils.isUnread(report)) {

Check failure on line 253 in src/pages/home/report/ReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Property 'referrer' does not exist on type 'Readonly<{ reportActionID: string; reportID: string; openOnAdminRoom?: boolean | undefined; }>'.

Check failure on line 253 in src/pages/home/report/ReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Property 'referrer' does not exist on type 'Readonly<{ reportActionID: string; reportID: string; openOnAdminRoom?: boolean | undefined; }>'.
if (Visibility.isVisible() && scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD) {
if ((Visibility.isVisible() || route?.params?.referrer === 'notification') && scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD) {
Report.readNewestAction(report.reportID);
Navigation.setParams({ referrer: undefined });
} else {
readActionSkipped.current = true;
}
Expand Down

0 comments on commit 6023e76

Please sign in to comment.