Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,12 @@ function markCommentAsUnread(reportID: string, reportActionCreated: string) {

// Find the latest report actions from other users
const latestReportActionFromOtherUsers = Object.values(reportActions ?? {}).reduce((latest: ReportAction | null, current: ReportAction) => {
if (current.actorAccountID !== currentUserAccountID && (!latest || current.created > latest.created)) {
if (
current.actorAccountID !== currentUserAccountID &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style is odd, this should go after the if not in a new line 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier doesn't allow me to move it after the if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few codes that has the same style, for example,

useEffect(() => {
if (
scrollingVerticalOffset.current < AUTOSCROLL_TO_TOP_THRESHOLD &&
previousLastIndex.current !== lastActionIndex &&
reportActionSize.current > sortedVisibleReportActions.length &&
hasNewestReportAction
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow so ugly but sure 😄

(!latest || current.created > latest.created) &&
// Whisper action doesn't affect lastVisibleActionCreated, so skip whisper action except actionable mention whisper
(!ReportActionsUtils.isWhisperAction(current) || current.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER)
) {
return current;
}
return latest;
Expand Down