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

[CP Staging] Stop showing receipt images for cash requests #25800

Merged
merged 5 commits into from
Aug 23, 2023
Merged
Changes from 2 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
9 changes: 7 additions & 2 deletions src/libs/ReceiptUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ function validateReceipt(file) {
* Grab the appropriate receipt image and thumbnail URIs based on file type
*
* @param {String} path URI to image, i.e. blob:new.expensify.com/9ef3a018-4067-47c6-b29f-5f1bd35f213d or expensify.com/receipts/w_e616108497ef940b7210ec6beb5a462d01a878f4.jpg
* @param {String} filename of uploaded image or last part of remote URI
* @param {String} [filename] of uploaded image or last part of remote URI
* @returns {Object}
*/
function getThumbnailAndImageURIs(path, filename) {
function getThumbnailAndImageURIs(path, filename = '') {
// For things that don't actually have files we will show the generic receipt icon.
if (!filename) {
return {thumbnail: null, image: ReceiptGeneric};
}
Copy link
Contributor

@aldo-expensify aldo-expensify Aug 23, 2023

Choose a reason for hiding this comment

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

I think this is better placed right after if (path.startsWith('blob:') || path.startsWith('file:')) {. So if the function is called with a path and no filename we still return return {thumbnail: null, image: path}; like we used to


// For local files, we won't have a thumbnail yet
if (path.startsWith('blob:') || path.startsWith('file:')) {
return {thumbnail: null, image: path};
Expand Down
Loading