Skip to content

Commit

Permalink
Merge pull request #45750 from callstack-internal/improve-isEmptyRepo…
Browse files Browse the repository at this point in the history
…rt-performance

[No QA] Improve isEmptyReport performance
  • Loading branch information
arosiclair authored Jul 19, 2024
2 parents 4cc2acb + 001bf73 commit 064cbc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5239,8 +5239,13 @@ function isEmptyReport(report: OnyxEntry<Report>): boolean {
if (!report) {
return true;
}

if (report.lastMessageText ?? report.lastMessageTranslationKey) {
return false;
}

const lastVisibleMessage = getLastVisibleMessage(report.reportID);
return !report.lastMessageText && !report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;
return !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;
}

function isUnread(report: OnyxEntry<Report>): boolean {
Expand Down

0 comments on commit 064cbc7

Please sign in to comment.