From d5b537da4648aefdafa435a91741e99508676f5f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 24 Oct 2019 13:09:57 +0300 Subject: [PATCH 1/2] DEXW-2215: set waves fee available if buy waves --- .../dex/directives/createOrder/CreateOrder.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 5f34918bc6..2c5ec20d81 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -48,6 +48,13 @@ return this.amountBalance && this.priceBalance && this.fee; } + /** + * @return {boolean} + */ + get buyWaves() { + return this.type === 'buy' && this.amount.asset.id === WavesApp.defaultAssets.WAVES; + } + /** * Max amount (with fee) * @type {Money} @@ -299,6 +306,8 @@ } $scope.$apply(); }); + + this.observe(['amount', 'type'], this._updateFeeList); } /** @@ -941,7 +950,12 @@ ); }); - const filteredFeeList = feeList.filter((fee, i) => fee.lte(balances[i])); + const filteredFeeList = feeList.filter((fee, i) => { + const buyWavesGtWavesFee = fee.asset.id === WavesApp.defaultAssets.WAVES && + this.buyWaves && + this.amount.getTokens().gt(fee.getTokens()); + return fee.lte(balances[i]) || buyWavesGtWavesFee; + }); if (!filteredFeeList.length) { this.fee = feeList[0]; From 3fc5e538a4a4c22221bc7f49a9b941bf75ff6428 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 24 Oct 2019 14:34:40 +0300 Subject: [PATCH 2/2] DEXW-2215: set waves fee available --- .../dex/directives/createOrder/CreateOrder.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 2c5ec20d81..2598600436 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -48,13 +48,6 @@ return this.amountBalance && this.priceBalance && this.fee; } - /** - * @return {boolean} - */ - get buyWaves() { - return this.type === 'buy' && this.amount.asset.id === WavesApp.defaultAssets.WAVES; - } - /** * Max amount (with fee) * @type {Money} @@ -306,8 +299,6 @@ } $scope.$apply(); }); - - this.observe(['amount', 'type'], this._updateFeeList); } /** @@ -951,10 +942,7 @@ }); const filteredFeeList = feeList.filter((fee, i) => { - const buyWavesGtWavesFee = fee.asset.id === WavesApp.defaultAssets.WAVES && - this.buyWaves && - this.amount.getTokens().gt(fee.getTokens()); - return fee.lte(balances[i]) || buyWavesGtWavesFee; + return fee.lte(balances[i]) || fee.asset.id === WavesApp.defaultAssets.WAVES; }); if (!filteredFeeList.length) {