Skip to content

Commit

Permalink
chore(typescript): apply pull request suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
pac-guerreiro committed Feb 1, 2024
1 parent 952f55e commit cc6f45b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type MoneyRequestHeaderProps = MoneyRequestHeaderOnyxProps & {
policy: Policy;

/** The report action the transaction is tied to from the parent report */
parentReportAction: ReportAction & OriginalMessageIOU;
parentReportAction?: ReportAction & OriginalMessageIOU;
};

function MoneyRequestHeader({session, parentReport, report, parentReportAction, transaction, policy}: MoneyRequestHeaderProps) {
Expand All @@ -59,10 +59,10 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction,
const {isSmallScreenWidth, windowWidth} = useWindowDimensions();

// Only the requestor can take delete the request, admins can only edit it.
const isActionOwner = typeof parentReportAction.actorAccountID === 'number' && typeof session?.accountID === 'number' && parentReportAction.actorAccountID === session?.accountID;
const isActionOwner = typeof parentReportAction?.actorAccountID === 'number' && typeof session?.accountID === 'number' && parentReportAction.actorAccountID === session?.accountID;

const deleteTransaction = useCallback(() => {
IOU.deleteMoneyRequest(parentReportAction.originalMessage?.IOUTransactionID ?? '', parentReportAction, true);
IOU.deleteMoneyRequest(parentReportAction?.originalMessage?.IOUTransactionID ?? '', parentReportAction ?? {}, true);
setIsDeleteModalVisible(false);
}, [parentReportAction, setIsDeleteModalVisible]);

Expand Down

0 comments on commit cc6f45b

Please sign in to comment.