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 blank preview when opened URL of deleted file #42680

Merged
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/components/Attachments/AttachmentCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source,
const attachmentsFromReport = extractAttachmentsFromReport(parentReportAction, reportActions ?? undefined);

if (isEqual(attachments, attachmentsFromReport)) {
if (attachments.length === 0) {
setPage(-1);
}
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to make a little refactor here as we also need to call setDownloadButtonVisibility to hide the download button.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually it may be better to remove this early return and remove the unnecessary dependencies same as in index.native.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we also need to call setDownloadButtonVisibility to hide the download button.

Oh, I didn't notice this one. Updated.

Actually it may be better to remove this early return and remove the unnecessary dependencies same as in index.native.ts

I thought about this one before too, but it was added in the video player PR #30829. I can't find a discussion for that though, so not sure if it's safe to change the deps.

}

Expand Down
Loading