Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/pdf not showing for money request #40385

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
isLocalFile && Str.isPDF(receiptFilename) ? (
<PDFThumbnail
// eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style
previewSourceURL={resolvedThumbnail as string}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this fix this? I would imagine that the thumbnail should be the source for <PDFThumbnail?

Copy link
Contributor Author

@ishpaul777 ishpaul777 Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was like this before, thats exactly what made me believe thumbnail goes here lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we see why this is failing? or what is even in resolvedThumbnail?

Perhaps we just change it to this
resolvedThumbnail || resolvedReceiptImage || ''

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep i'll give this fair look again tomorrow, currently got afk

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we just change it to this
resolvedThumbnail || resolvedReceiptImage || ''

No need IMO, local files don't have thumbnail:

if ((isReceiptImage || isReceiptPDF) && typeof path === 'string' && (path.startsWith('blob:') || path.startsWith('file:'))) {
return {image: path, isLocalFile: true, filename};
}

previewSourceURL={resolvedReceiptImage as string}
style={styles.moneyRequestImage}
// We don't support scaning password protected PDF receipt
enabled={!isAttachmentInvalid}
Expand Down
Loading