This should ensure comments are only submitting ones, not more.
Fixes https://pagure.io/pagure/issue/1407
1 new commit added
This question is born of complete ignorance of JavaScript. Since this function is defined in issue.html as well, does it make sense to consolidate this in one place? Is that a big hassle in JavaScript?
This seems to log "true" or "false" to the console without much context. Is it possible to expand this slightly to indicate what is true or false and where the log entry is emitted from?
Sorry for the very slow PR reviews. I did learn a bit more about the Firefox developer console from this, though!
I am honestly still quite lost when it comes to JavaScript. It looks reasonable to me, and I was unable to duplicate the duplicate responses with this patch. I stepped through this bit of JavaScript and it does indeed change the attribute on the button and the cursor style, but I confess to not understanding at a deep level why this works.
What I'm trying to say is this looks good to me, but I don't know how much that's worth :slight_smile:
I'll just remove this one, it's not much needed anymore.
We could consolidate this function into an single file and maybe we should indeed.
The basic idea is that we disable all the submits button when an user click on one, this way we're sure they won't click a second time.
Then according to the different situation (POST request worked, no SSE server, request is to delete a comment), we turn the buttons back on.
If you have specific piece of code you would like to have more info about, feel free to ping me :)
rebased
Pull-Request has been merged by pingou
This should ensure comments are only submitting ones, not more.
Fixes https://pagure.io/pagure/issue/1407