-
Notifications
You must be signed in to change notification settings - Fork 16
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 cancel download, content not clearing, search preview content type #1717
Conversation
Your Render PR Server URL is https://files-ui-stage-pr-1717.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c64pajvs437tos1mvfp0. |
Your Render PR Server URL is https://gaming-ui-stage-pr-1717.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c64pakfs437tos1mvgc0. |
Your Render PR Server URL is https://storage-ui-stage-pr-1717.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c64pakvs437tos1mvglg. |
…hub.com/ChainSafe/files-ui into fix/file-name-repeated-in-the-path-1499
I wasn't too sure what you meant by the content type being guessed if not explicitly set. I tried removing some of the file extensions (eg remove .jpg) to see if it would still show an image icon and it did but it also currently does that in prod some I'm assuming it's not in relation to that? Also, the part about the preview window being cleared after the effect is run - which effect is that and how do I invoke that? |
The content-type
After this fix, each time the user switches to a new file to be previewed, the file contents are cleared and only populated if a valid preview renderer is available. When the user downloads the file with no preview, the download request is correctly initiated and the correct binary is saved to disk. |
@@ -215,8 +215,8 @@ const FilePreviewModal = ({ file, nextFile, previousFile, closePreview, filePath | |||
bucketId = bucket.id | |||
} | |||
|
|||
setFileContent(undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is related, but when I browse a folder content from the file preview, using the arrows, I keep getting an error "an error occurred while generating the preview" if I don't wait for the initial file to load.
Here an example. I browse slowly (e.g I wait for the file to be previewed), all image show. Then I start clicking faster, so the file preview don't have time to load and show the page, then the error appears.
preview.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this, and should be dealt with in a separate issue - #1725
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, then we're good to go!
@FSM1 Thank you for the explanation of the change. I wasn't aware of the "guessing" type or the other issue with wrong file being downloaded so that was very insightful :) |
Yeah the content-type guessing was a temporary work around from the early days of the project, when the API was not storing this data. Once this got resolved and the content-type was correctly being returned, I was going to remove the guessing code, but eventually decided to leave it in for weird cases like the above referenced one (HEIC images from windows). |
In attempting to cause #1499 to occur, I fixed a couple of other small issues.