Ignore double clicks on reaction buttons
authorAlexander Ebert <ebert@woltlab.com>
Tue, 2 Jun 2020 15:02:45 +0000 (17:02 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 2 Jun 2020 15:02:45 +0000 (17:02 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js

index 89e614d1eed07cc6f9474e25dc3dbb5442d8c280..7e0a60363cc42369cb1992b50444fd4add17f66b 100644 (file)
@@ -353,6 +353,12 @@ define(
                         * @param       {init}          reactionTypeId
                         */
                        _react: function(reactionTypeId) {
+                               if (~~this._popoverCurrentObjectId === 0) {
+                                       // Double clicking the reaction will cause the first click to go through, but
+                                       // causes the second to fail because the overlay is already closing.
+                                       return;
+                               }
+                               
                                this._options.parameters.reactionTypeID = reactionTypeId;
                                this._options.parameters.data.objectID = this._popoverCurrentObjectId;
                                this._options.parameters.data.objectType = this._objectType;