Skip to content

Commit b1658e2

Browse files
committed
fix: comments
1 parent fedd2df commit b1658e2

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/components/MoneyRequestConfirmationListFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function MoneyRequestConfirmationListFooter({
338338
() => ({
339339
anchor: null,
340340
report: undefined,
341-
isReportArchived: undefined,
341+
isReportArchived: false,
342342
action: undefined,
343343
checkIfContextMenuActive: () => {},
344344
onShowContextMenu: () => {},

src/components/ReportActionItem/TaskView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function TaskView({report, parentReport, action}: TaskViewProps) {
7373
() => ({
7474
anchor: null,
7575
report,
76-
isReportArchived: undefined,
76+
isReportArchived: false,
7777
action,
7878
transactionThreadReport: undefined,
7979
checkIfContextMenuActive: () => {},

src/components/ShowContextMenuContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {Report, ReportAction} from '@src/types/onyx';
1212
type ShowContextMenuContextProps = {
1313
anchor: ContextMenuAnchor;
1414
report: OnyxEntry<Report>;
15-
isReportArchived?: boolean;
15+
isReportArchived: boolean;
1616
action: OnyxEntry<ReportAction>;
1717
transactionThreadReport?: OnyxEntry<Report>;
1818
checkIfContextMenuActive: () => void;
@@ -25,7 +25,7 @@ const ShowContextMenuContext = createContext<ShowContextMenuContextProps>({
2525
anchor: null,
2626
onShowContextMenu: (callback) => callback(),
2727
report: undefined,
28-
isReportArchived: undefined,
28+
isReportArchived: false,
2929
action: undefined,
3030
transactionThreadReport: undefined,
3131
checkIfContextMenuActive: () => {},

src/libs/OptionsListUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ function hasHiddenDisplayNames(accountIDs: number[]) {
716716
/**
717717
* Get the last message text from the report directly or from other sources for special cases.
718718
*/
719-
function getLastMessageTextForReport(report: OnyxEntry<Report>, lastActorDetails: Partial<PersonalDetails> | null, policy?: OnyxEntry<Policy>, isReportArchived?: boolean): string {
719+
function getLastMessageTextForReport(report: OnyxEntry<Report>, lastActorDetails: Partial<PersonalDetails> | null, policy?: OnyxEntry<Policy>, isReportArchived = false): string {
720720
const reportID = report?.reportID;
721721
const lastReportAction = reportID ? lastVisibleReportActions[reportID] : undefined;
722722

@@ -965,7 +965,7 @@ function createOption(accountIDs: number[], personalDetails: OnyxInputOrEntry<Pe
965965
const lastActorAccountID = report.lastActorAccountID || lastAction?.actorAccountID;
966966
const lastActorDetails = lastActorAccountID ? (personalDetails?.[lastActorAccountID] ?? null) : null;
967967
const lastActorDisplayName = getLastActorDisplayName(lastActorDetails);
968-
const lastMessageTextFromReport = getLastMessageTextForReport(report, lastActorDetails, undefined, !!reportNameValuePairs?.private_isArchived);
968+
const lastMessageTextFromReport = getLastMessageTextForReport(report, lastActorDetails, undefined, !!result.private_isArchived);
969969
let lastMessageText = lastMessageTextFromReport;
970970

971971
const shouldDisplayLastActorName =

src/libs/SidebarUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ function getOptionData({
648648
const lastActorDisplayName = getLastActorDisplayName(lastActorDetails);
649649
let lastMessageTextFromReport = lastMessageTextFromReportProp;
650650
if (!lastMessageTextFromReport) {
651-
lastMessageTextFromReport = getLastMessageTextForReport(report, lastActorDetails, policy, !!reportNameValuePairs?.private_isArchived);
651+
lastMessageTextFromReport = getLastMessageTextForReport(report, lastActorDetails, policy, !!result?.private_isArchived);
652652
}
653653

654654
// We need to remove sms domain in case the last message text has a phone number mention with sms domain.

src/pages/TransactionDuplicate/Confirmation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function Confirmation() {
7272
report,
7373
checkIfContextMenuActive: () => {},
7474
onShowContextMenu: () => {},
75-
isReportArchived: undefined,
75+
isReportArchived: false,
7676
anchor: null,
7777
isDisabled: false,
7878
}),

tests/unit/VideoRendererTest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jest.mock('@components/VideoPlayerPreview', () => {
3737
const mockShowContextMenuValue = {
3838
anchor: null,
3939
report: undefined,
40-
isReportArchived: undefined,
40+
isReportArchived: false,
4141
action: undefined,
4242
transactionThreadReport: undefined,
4343
checkIfContextMenuActive: () => {},

0 commit comments

Comments
 (0)