-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use Xhr to upload and show progress #116
base: master
Are you sure you want to change the base?
Conversation
This is great! Thank you for using this tool and taking the time to improve it! I've added a couple of comments, and if you don't get time to take a look, I'll happily amend these when I do! I'd like to reimplement the progress bar at some point (I started way back when, might've even had it working originally before switching to Let me know if you have any questions, but glad the contributions and DX has worked for you! |
oh, missed your general comment previously. Yes, I agree that progress bar would be better, and I also was thinking about "Cancel" button to cancel each upload (since XHR can be cancelled), but let's keep these in TODO for now, since progress bar might need a discussion regarding size/location/color :) |
PR updated! I think all suggestions are addressed, please let me know if I missed some (I actually don't know what these letters Also, let me know if there are any other improvements I can make here, or shall I cleanup the history for merge. |
In general this looks great! I've added another comment above, shout if you have any concerns! As for Thanks for your patience on this! |
Lets you track progress (pass a callback function as onProgress argument)
Also make arguments optional
Sadly, I don't speak these languages, so I used an online service to translate "5 of 10 uploaded" sentense into them, and then updated templates accordingly.
9af5156
to
de92164
Compare
I saw that you had some styles for
.progress .meter
but didn't find any elements created so (ab)used the size field.Also, "placeholder" property of Entry is used as a flag to show that relevant file is being uploaded. It works for now, but if someone else will want to use it for something else in the future, there might be a conflict.
Also, I tried to
reject
promise and process it inside atry{...} catch
block, but didn't succeed in providing type hints that would satisfy VS Code, so instead of that,XHRPutFile
now returns a promise with XMLHttpRequest object, which is verified outside of that function.