From 9177daea7bbf97411ac56d72b36d0d56cc854085 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 6 May 2024 11:04:19 +0700 Subject: [PATCH] cast isDistanceRequest to boolean --- src/components/ReportActionItem/ReportActionItemImage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ReportActionItem/ReportActionItemImage.tsx b/src/components/ReportActionItem/ReportActionItemImage.tsx index c2e7b2630998..4e7f123a2fb2 100644 --- a/src/components/ReportActionItem/ReportActionItemImage.tsx +++ b/src/components/ReportActionItem/ReportActionItemImage.tsx @@ -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; @@ -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}; @@ -94,7 +94,7 @@ function ReportActionItemImage({ shouldUseThumbnailImage: true, isAuthTokenRequired: false, source: thumbnail ?? image ?? '', - shouldUseInitialObjectPosition: isDistanceRequest ?? false, + shouldUseInitialObjectPosition: isDistanceRequest, }; }