Skip to content

Commit 0d87bdf

Browse files
committed
fix: fix format amounts for send input
1 parent ab4f208 commit 0d87bdf

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "liquality-wallet",
3-
"version": "0.17.5",
3+
"version": "0.17.6",
44
"private": true,
55
"license": "MIT",
66
"author": "Liquality <[email protected]>",

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "0.17.5",
3+
"version": "0.17.6",
44
"name": "Liquality Wallet",
55
"description": "Secure multi-crypto wallet with built-in Atomic Swaps!",
66
"homepage_url": "https://liquality.io",

src/views/Account.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<div class="account_balance">
1313
<div class="account_balance_fiat">
1414
<span v-if="fiatRates[asset]" >
15-
${{prettyFiatBalance(balance, fiatRates[asset])}}
15+
${{ prettyFiatBalance(balance, fiatRates[asset]) }}
1616
</span>
1717
<span v-else>&nbsp;</span>
1818
</div>
1919
<div>
2020
<span class="account_balance_value"
2121
:style="{ fontSize: balanceFontSize }">
22-
{{balance}}
22+
{{ balance }}
2323
</span>
2424
<span class="account_balance_code">{{asset}}</span>
2525
</div>

src/views/Send.vue

+19-11
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
<span class="input-group-text">{{ asset }}</span>
2727
</div>
2828
<input
29-
type="number"
30-
:max="available"
31-
min="0"
29+
type="text"
30+
maxlength="8"
31+
pattern="\d*"
3232
:class="{ 'is-invalid': amount && amountError }"
3333
:style="getAssetColorStyle(asset)"
34-
v-model="sendAmount"
34+
v-model="amount"
3535
class="form-control"
3636
id="amount"
3737
placeholder="0.00"
@@ -144,7 +144,7 @@
144144
</label>
145145
<div class="d-flex align-items-center justify-content-between mt-0">
146146
<div class="confirm-value" :style="getAssetColorStyle(asset)">
147-
{{ prettyBalance(amount, asset) }} {{ asset }}
147+
{{ dpUI(amount) }} {{ asset }}
148148
</div>
149149
<div class="details-text">${{ amountInFiat }}</div>
150150
</div>
@@ -166,7 +166,7 @@
166166
</label>
167167
<div class="d-flex align-items-center justify-content-between mt-0">
168168
<div class="font-weight-bold" v-if="asset === feeType">
169-
{{ prettyBalance(amountWithFee, asset) }} {{ asset }}
169+
{{ dpUI(amountWithFee) }} {{ asset }}
170170
</div>
171171
<div class="font-weight-bold" v-else>
172172
{{ prettyBalance(amount, asset) }} {{ asset }} + {{ prettyFee }} {{ feeType }}
@@ -234,7 +234,7 @@ export default {
234234
},
235235
data () {
236236
return {
237-
amount: 0,
237+
stateAmount: 0,
238238
address: null,
239239
selectedFee: 'average',
240240
showConfirm: false,
@@ -246,12 +246,20 @@ export default {
246246
asset: String
247247
},
248248
computed: {
249-
sendAmount: {
249+
amount: {
250250
get () {
251-
return dpUI(this.amount)
251+
return this.stateAmount
252252
},
253253
set (newValue) {
254-
this.amount = BN(newValue)
254+
if (newValue && !isNaN(newValue)) {
255+
if (BN(newValue).gt(0)) {
256+
this.stateAmount = dpUI(newValue).toNumber()
257+
} else {
258+
this.stateAmount = newValue
259+
}
260+
} else {
261+
this.stateAmount = 0
262+
}
255263
}
256264
},
257265
...mapState([
@@ -372,7 +380,7 @@ export default {
372380
toogleMaxAmount () {
373381
this.maxOptionActive = !this.maxOptionActive
374382
if (this.maxOptionActive) {
375-
this.amount = this.available
383+
this.amount = dpUI(this.available)
376384
}
377385
},
378386
back () {

0 commit comments

Comments
 (0)