Disable like button b/w click & backend response (#4869) [deploy]
This commit is contained in:
parent
c8903876c6
commit
9d7817b025
1 changed files with 2 additions and 0 deletions
|
|
@ -75,6 +75,7 @@ function initializeCommentsPage() {
|
|||
}
|
||||
|
||||
thisButt.classList.add('reacted');
|
||||
thisButt.disabled = true;
|
||||
|
||||
function successCb(response) {
|
||||
var reactionCountSpan = thisButt.children[2];
|
||||
|
|
@ -96,6 +97,7 @@ function initializeCommentsPage() {
|
|||
getCsrfToken()
|
||||
.then(sendFetch('reaction-creation', formData))
|
||||
.then(function (response) {
|
||||
thisButt.disabled = false;
|
||||
if (response.status === 200) {
|
||||
response.json().then(successCb);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue