-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
prevent comment on uploading #32263
base: main
Are you sure you want to change the base?
prevent comment on uploading #32263
Conversation
@yp05327 |
await uploadFile(dropzoneEl, file); // the "file" will get its "uuid" during the upload | ||
dropzoneEl.dropzone.off('thumbnail', handleInsertPlaceholder); |
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.
It still doesn't seem right.
await
might fail and throw an exception, then the handler is left there.- If there are more than 1 files are being uploaded (in progress), then it will trigger more than one
handleInsertPlaceholder
calls, duplicate calls will insert duplicate placeholders ? For example, 2 files being uploaed, then 3 placeholders would be inserted?
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 corrected the first point, but I don't know how to solve the second problem. If you think of a way, can you suggest a solution?
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.
There is one more bad case: if a uploading fails, then there will be no onContentChanged callback, then the buttons stay "disabled".
I think the UI states should be managed by some well-defined events&handlers, but not by an ad-hoc "thumbnail" event with onContentChanged callback.
0a116c6
to
f3c7c26
Compare
I rewrote my code. Please review again. |
fix #32262
fix for new comment
fix for edit comment