From 2cbd55c09b201ebcc6253925157d0407a064f72e Mon Sep 17 00:00:00 2001 From: Nikita-Polyakov Date: Mon, 24 Oct 2022 12:50:33 +0300 Subject: [PATCH 1/2] fix max btn visibility for remove liquidity & farming --- src/modules/demeterFarming/components/StakeDialog.vue | 1 + src/views/RemoveLiquidity.vue | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/modules/demeterFarming/components/StakeDialog.vue b/src/modules/demeterFarming/components/StakeDialog.vue index aca6ae8db..1871a3d46 100644 --- a/src/modules/demeterFarming/components/StakeDialog.vue +++ b/src/modules/demeterFarming/components/StakeDialog.vue @@ -33,6 +33,7 @@
% % Date: Mon, 24 Oct 2022 13:30:39 +0300 Subject: [PATCH 2/2] add MAX_PART --- src/views/RemoveLiquidity.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/RemoveLiquidity.vue b/src/views/RemoveLiquidity.vue index 5864d34a3..2998f0c2e 100644 --- a/src/views/RemoveLiquidity.vue +++ b/src/views/RemoveLiquidity.vue @@ -14,7 +14,7 @@ :value="String(removePartInput)" :decimals="0" :disabled="liquidityLocked" - :max="100" + :max="MAX_PART" @input="handleRemovePartChange" @focus="setFocusedField('removePart')" @blur="resetFocusedField" @@ -29,7 +29,7 @@ alternative size="mini" border-radius="mini" - @click.stop="handleRemovePartChange(100)" + @click.stop="handleRemovePartChange(MAX_PART)" > {{ t('buttons.max') }} @@ -159,6 +159,7 @@ export default class RemoveLiquidity extends Mixins( NetworkFeeDialogMixin ) { readonly XOR_SYMBOL = XOR.symbol; + readonly MAX_PART = 100; @state.removeLiquidity.liquidityAmount private liquidityAmount!: string; @state.removeLiquidity.focusedField private focusedField!: string; @@ -318,12 +319,12 @@ export default class RemoveLiquidity extends Mixins( } get isMaxButtonAvailable(): boolean { - return this.removePart !== 100; + return this.removePart !== this.MAX_PART; } handleRemovePartChange(value: string): void { const newValue = parseFloat(value) || 0; - this.removePartInput = Math.min(Math.max(newValue, 0), 100); + this.removePartInput = Math.min(Math.max(newValue, 0), this.MAX_PART); this.setRemovePart(this.removePartInput); }