Skip to content

Commit

Permalink
cast isDistanceRequest to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed May 6, 2024
1 parent a437df0 commit 9177dae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ReportActionItem/ReportActionItemImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function ReportActionItemImage({
const attachmentModalSource = tryResolveUrlFromApiRoot(image ?? '');
const thumbnailSource = tryResolveUrlFromApiRoot(thumbnail ?? '');
const isEReceipt = transaction && TransactionUtils.hasEReceipt(transaction);
const isDistanceRequest = transaction && TransactionUtils.isDistanceRequest(transaction);
const isDistanceRequest = Boolean(transaction && TransactionUtils.isDistanceRequest(transaction));

let propsObj: ReceiptImageProps;

Expand All @@ -83,7 +83,7 @@ function ReportActionItemImage({
fallbackIcon: Expensicons.Receipt,
fallbackIconSize: isSingleImage ? variables.iconSizeSuperLarge : variables.iconSizeExtraLarge,
isAuthTokenRequired: true,
shouldUseInitialObjectPosition: isDistanceRequest ?? false,
shouldUseInitialObjectPosition: isDistanceRequest,
};
} else if (isLocalFile && filename && Str.isPDF(filename) && typeof attachmentModalSource === 'string') {
propsObj = {isPDFThumbnail: true, source: attachmentModalSource};
Expand All @@ -94,7 +94,7 @@ function ReportActionItemImage({
shouldUseThumbnailImage: true,
isAuthTokenRequired: false,
source: thumbnail ?? image ?? '',
shouldUseInitialObjectPosition: isDistanceRequest ?? false,
shouldUseInitialObjectPosition: isDistanceRequest,
};
}

Expand Down

0 comments on commit 9177dae

Please sign in to comment.