We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit c08778dd authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #249 from ho-nl-fork/fix-racecondition

Place Order function race condition fix
parents cfb02277 bbd8e11f
...@@ -152,6 +152,15 @@ define( ...@@ -152,6 +152,15 @@ define(
isActive: function () { isActive: function () {
return true; return true;
}, },
/**
* Returns state of place order button
* @returns {boolean}
*/
isButtonActive: function() {
return this.isActive() && this.getCode() == this.isChecked() && this.isPlaceOrderActionAllowed();
},
/** /**
* @override * @override
*/ */
......
...@@ -280,12 +280,9 @@ ...@@ -280,12 +280,9 @@
<div class="primary"> <div class="primary">
<button class="action primary checkout" <button class="action primary checkout"
type="submit" type="submit"
data-bind=" data-bind="click: placeOrder,
click: placeOrder,
attr: {title: $t('Place Order')}, attr: {title: $t('Place Order')},
enable: (getCode() == isChecked()), enable: isButtonActive()"
css: {disabled: !isPlaceOrderActionAllowed()}
"
disabled> disabled>
<span data-bind="text: $t('Place Order')"></span> <span data-bind="text: $t('Place Order')"></span>
</button> </button>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment