-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
refactor: add use-download-files hook for downloading files on chat #3399
Conversation
This commit adds a new hook called useGetDownloadFileMutation to handle the downloading of files in the frontend. The hook takes in the path and filename as parameters and uses the fetch API to download the file. It then creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.
This commit adds a new hook called use-download-files to handle the downloading of files in the frontend. The hook takes in the path and filename as parameters and uses the fetch API to download the file. It then creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.
Pull Request Validation ReportThis comment is automatically generated by Conventional PR Whitelist Report
Result Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated. Validation Report
Result Pull request satisfies all enabled pull request rules. Last Modified at 16 Aug 24 21:21 UTC |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Refactor the file download handling in the chat view by introducing a new hook called `use-download-files`. This hook takes in the path and filename as parameters and uses the fetch API to download the file. It creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.
This commit adds a new hook called use-download-files to handle the downloading of files in the frontend. The hook takes in the path and filename as parameters and uses the fetch API to download the file. It then creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.