-
Notifications
You must be signed in to change notification settings - Fork 5
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
105 UI #268
105 UI #268
Conversation
window.onbeforeunload = (event) => { | ||
event.preventDefault(); | ||
if (uploadTasks.size !== 0) { | ||
event.returnValue = 'Your file has not finished uploading'; |
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.
This only results in a custom message in Safari; there aren't ways to add custom messages for Firefox and Chrome.
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 Alli, this worked for me in Chrome, Firefox and Safari.
Not related to this PR: I noticed that Safari is not letting me upload some file formats (.mp3, .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.
Code looks good - needs changes to only show the prompt on navigating away from DPE or closing the tab as upload continues when staying within the app :)
I'm actually not able to replicate this on all files, Tamsin! I've navigated within the app when uploading two test files yesterday, and neither have finished uploading to Firestore, from what I can see. Neither xAVhAuWyNLASZ0xZLB0B nor cbR57... are in the uploads folder for our admin user. Screenshots of the associated transcripts are below; these are stuck on On a separate note, ideally these should probably have |
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.
No prompt when I navigate elsewhere in the app; prompt when I try to close the tab 💫
Is your Pull Request request related to another issue in this repository ?
See #105 in Storybook
Describe what the PR does
Adds prompt if user tries to navigate away from DPE while media is uploadingsee Preserve upload task progress when navigating in the app #284State whether the PR is ready for review or whether it needs extra work
Ready
Additional context
Please review with the related Storybook PR to see all of the fixes for the relevant issue.
We don't have options to customise the alerts / prompts, and so I have not been able to implement Ngan-Thi's designs exactly for these. We can only customise strings for the prompt message when users try to click links during uploads, and we only have custom string support on IE for the alert when the user tries to close the window.
To test: