Skip to content

Commit

Permalink
fix: typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
kubabutkiewicz committed Jan 25, 2024
1 parent 500833d commit 691fef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function LHNOptionsList({
const transactionID = itemParentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? itemParentReportAction.originalMessage.IOUTransactionID ?? '' : '';
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`] ?? null;
const itemComment = draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`] ?? '';
const participants = [...ReportUtils.getParticipantsIDs(itemFullReport), itemFullReport?.ownerAccountID, itemParentReportAction?.actorAccountID];
const participants = [...ReportUtils.getParticipantsIDs(itemFullReport), itemFullReport?.ownerAccountID, itemParentReportAction?.actorAccountID].filter(Boolean) as number[];
const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails);

return (
Expand All @@ -58,7 +58,6 @@ function LHNOptionsList({
reportActions={itemReportActions}
parentReportAction={itemParentReportAction}
policy={itemPolicy}
// @ts-expect-error TODO: Remove this once OptionsListUtils (https://github.com/Expensify/App/issues/24921) is migrated to TypeScript.
personalDetails={participantsPersonalDetails}
transaction={itemTransaction}
receiptTransactions={transactions}
Expand Down
8 changes: 7 additions & 1 deletion src/components/LHNOptionsList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type CustomLHNOptionsListProps = {
data: string[];

/** Callback to fire when a row is selected */
onSelectRow: (reportID: string) => void;
onSelectRow?: (optionItem: OptionData, popoverAnchor: RefObject<View>) => void;

/** Toggle between compact and default view of the option */
optionMode: OptionMode;
Expand Down Expand Up @@ -97,6 +97,12 @@ type OptionRowLHNDataProps = {

/** Whether the user can use violations */
canUseViolations: boolean | undefined;

/** Toggle between compact and default view */
viewMode?: OptionMode;

/** A function that is called when an option is selected. Selected option is passed as a param */
onSelectRow?: (optionItem: OptionData, popoverAnchor: RefObject<View>) => void;
};

type OptionRowLHNProps = {
Expand Down

0 comments on commit 691fef8

Please sign in to comment.