From 74930c967349b9c5d760ef6565b8558736109e9a Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Wed, 11 May 2022 16:16:49 +0530 Subject: [PATCH] minor UX improvements --- docs/index.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/index.html b/docs/index.html index dcbf704..a4efd5a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -117,7 +117,7 @@
ASSETS
PRICE
-

Asset prices may change after timer is up.

+

Countdown shows next est. time until asset prices are updated

@@ -625,8 +625,8 @@ - +
Rupee @@ -635,6 +635,10 @@
+

*While withdrawing 100% of balance FLO, 0.1 FLO is reserved for + transactions + on blockchain. +

@@ -1858,12 +1862,10 @@ const type = target.value const asset = getRef('wallet_asset_selector').value - getRef('wallet_quantity_type').textContent = getRef('quantity_type').textContent = asset === 'rupee' ? formatAmount(allTokens.rupee.net, true) : `${parseFloat(allTokens[asset].net.toFixed(4))} ${asset}` + getRef('wallet_quantity_type').textContent = getRef('quantity_type').textContent = asset === 'rupee' ? formatAmount(allTokens.rupee.net, true) : `${parseFloat(allTokens[asset].net.toFixed(8))} ${asset}` getRef('wallet_popup__cta').textContent = `${type} ${asset}` getRef('wallet_popup__cta').setAttribute('value', type) getRef('wallet_popup__title').textContent = `${type} ${asset}` - getRef('get_user_amount').setAttribute('step', asset === 'rupee' ? '0.01' : '0.00001') - getRef('get_user_amount').setAttribute('min', asset === 'rupee' ? '0.01' : '0.00001') // default form element state getRef('get_receiver_id').removeAttribute('required') getRef('get_receiver_id').classList.add('hide') @@ -1872,6 +1874,9 @@ getRef('wallet_quantity_selector').classList.remove('hide') switch (type) { case 'withdraw': + if (asset === 'FLO') { + getRef('withdraw_flo_tip').classList.remove('hide') + } break; case 'deposit': getRef('get_private_key').setAttribute('required', '') @@ -1944,7 +1949,11 @@ const target = e.target.closest('button') const asset = getRef('wallet_asset_selector').value const fraction = parseFloat(target.value) - getRef('get_user_amount').value = parseFloat((allTokens[asset].net * fraction).toFixed(asset === "rupee" ? 2 : 4)) + let total = parseFloat((allTokens[asset].net * fraction).toFixed(8)); + if (asset == 'FLO' && fraction === 1 & total > 0.1) { + total -= 0.1; + } + getRef('get_user_amount').value = total } }) getRef('wallet_popup__cta').addEventListener('click', async e => { @@ -1991,6 +2000,7 @@ } finally { hideProcess('wallet_popup__cta_wrapper') + refresh() } }) @@ -2248,6 +2258,7 @@ switch (e.target.id) { case 'wallet_popup': hideWalletResult() + getRef('withdraw_flo_tip').classList.add('hide') break; } })