Skip to content

Commit 4c0796d

Browse files
committed
fix ts error
1 parent eb4bffd commit 4c0796d

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ function findLastAccessedReport(ignoreDomainRooms: boolean, openOnAdminRoom = fa
19441944
/**
19451945
* Whether the provided report has expenses
19461946
*/
1947-
function hasExpenses(reportID?: string, transactions?: SearchTransaction[] | Transaction[]): boolean {
1947+
function hasExpenses(reportID?: string, transactions?: SearchTransaction[] | Array<OnyxEntry<Transaction>>): boolean {
19481948
if (transactions) {
19491949
return !!transactions?.find((transaction) => transaction?.reportID === reportID);
19501950
}
@@ -1954,7 +1954,7 @@ function hasExpenses(reportID?: string, transactions?: SearchTransaction[] | Tra
19541954
/**
19551955
* Whether the provided report is a closed expense report with no expenses
19561956
*/
1957-
function isClosedExpenseReportWithNoExpenses(report: OnyxEntry<Report>, transactions?: SearchTransaction[] | Transaction[]): boolean {
1957+
function isClosedExpenseReportWithNoExpenses(report: OnyxEntry<Report>, transactions?: SearchTransaction[] | Array<OnyxEntry<Transaction>>): boolean {
19581958
return report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED && isExpenseReport(report) && !hasExpenses(report.reportID, transactions);
19591959
}
19601960

src/pages/home/report/ReportActionItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type ReportActionItemProps = Omit<PureReportActionItemProps, 'taskReport' | 'lin
4040
shouldShowDraftMessage?: boolean;
4141

4242
/** All the data of the transaction collection */
43-
transactions: Transaction[];
43+
transactions?: Array<OnyxEntry<Transaction>>;
4444
};
4545

4646
function ReportActionItem({allReports, action, report, transactions, shouldShowDraftMessage = true, ...props}: ReportActionItemProps) {

src/pages/home/report/ReportActionsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function ReportActionsList({
166166
const isFocused = useIsFocused();
167167

168168
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
169-
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: false});
169+
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
170170
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`, {canBeMissing: true});
171171
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.accountID, canBeMissing: true});
172172
const participantsContext = useContext(PersonalDetailsContext);
@@ -597,7 +597,7 @@ function ReportActionsList({
597597
shouldDisplayReplyDivider={sortedVisibleReportActions.length > 1}
598598
isFirstVisibleReportAction={firstVisibleReportActionID === reportAction.reportActionID}
599599
shouldUseThreadDividerLine={shouldUseThreadDividerLine}
600-
transactions={transactions}
600+
transactions={Object.values(transactions ?? {})}
601601
/>
602602
);
603603
},

src/pages/home/report/ReportActionsListItemRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type ReportActionsListItemRendererProps = {
1818
reportActions: ReportAction[];
1919

2020
/** All the data of the transaction collection */
21-
transactions: Transaction[];
21+
transactions: Array<OnyxEntry<Transaction>>;
2222

2323
/** The report's parentReportAction */
2424
parentReportAction: OnyxEntry<ReportAction>;

0 commit comments

Comments
 (0)