-
-
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
Open
sangcheol12
wants to merge
7
commits into
go-gitea:main
Choose a base branch
from
sangcheol12:fix/prevent-comment-on-uploading
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−5
Open
prevent comment on uploading #32263
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
992b0a0
prevent comment on uploading
sangcheol12 ddbefb7
add isUploding method in ComboMarkdownEditor
sangcheol12 d885025
prevent status button on uploading images
sangcheol12 e286eda
remove insert placeholder event handler after upload success
sangcheol12 7d13422
Add try-catch to handle potential upload errors in handleUploadFiles
sangcheol12 34cfdaf
disable modify button on image uploading
sangcheol12 f3c7c26
prevent upload button on uploading with callback
sangcheol12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as outdated.
Sorry, something went wrong.
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 just think again about the problem. It looks that the
setTimeout
is somewhat hacky, and it doesn't guarantee that it would work with other uploaders.I will try to make some new changes to introduce a separate event to handle this situation.
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.
In this suggestion, third parameter (placeholder) seems not to be necessary. isn't it
but in that case, disabling submit button doesn't working correctly.
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.
Yup, the first suggestion is to remove the
placeholderCallback
.But indeed the
setTimeout
seems somewhat hacky, and if we'd like to improve the uploader or change it in the future, it might become a blocker (or regression).So, a more general solution in my mind is: introduce a more general "opts.onUploadStateChanged" callback, make the ComboMarkdownEditor listen on Dropzone events and call the onUploadStateChanged, then UI code could sync the UI state accordingly. It could 100% isolate the business code and the uploader and be clearer.
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.
Well, one more thing ........ the current solution (onContentChanged) is also buggy when the user uploads a file by the Dropzone directly, there is no content change, then there is no "isUploading" check .....
Quote my previous comment:
So, the problem is not that simple as it looks. I will take a look when I have time.