Commit 829a9680 authored by Ian Lapham's avatar Ian Lapham Committed by Noah Zinsmeister

allow for ETH in output command, zupdate to 6 digits on exchange rate (#464)

parent bed886ad
...@@ -127,7 +127,11 @@ function getInitialSwapState(state) { ...@@ -127,7 +127,11 @@ function getInitialSwapState(state) {
independentField: state.exactFieldURL === 'output' ? OUTPUT : INPUT, independentField: state.exactFieldURL === 'output' ? OUTPUT : INPUT,
inputCurrency: state.inputCurrencyURL ? state.inputCurrencyURL : 'ETH', inputCurrency: state.inputCurrencyURL ? state.inputCurrencyURL : 'ETH',
outputCurrency: state.outputCurrencyURL outputCurrency: state.outputCurrencyURL
? state.outputCurrencyURL ? state.outputCurrencyURL === 'ETH'
? state.inputCurrencyURL && state.inputCurrencyURL !== 'ETH'
? 'ETH'
: ''
: state.outputCurrencyURL
: state.initialCurrency : state.initialCurrency
? state.initialCurrency ? state.initialCurrency
: '' : ''
...@@ -707,13 +711,13 @@ export default function ExchangePage({ initialCurrency, sending = false, params ...@@ -707,13 +711,13 @@ export default function ExchangePage({ initialCurrency, sending = false, params
{inverted ? ( {inverted ? (
<span> <span>
{exchangeRate {exchangeRate
? `1 ${inputSymbol} = ${amountFormatter(exchangeRate, 18, 4, false)} ${outputSymbol}` ? `1 ${inputSymbol} = ${amountFormatter(exchangeRate, 18, 6, false)} ${outputSymbol}`
: ' - '} : ' - '}
</span> </span>
) : ( ) : (
<span> <span>
{exchangeRate {exchangeRate
? `1 ${outputSymbol} = ${amountFormatter(exchangeRateInverted, 18, 4, false)} ${inputSymbol}` ? `1 ${outputSymbol} = ${amountFormatter(exchangeRateInverted, 18, 6, false)} ${inputSymbol}`
: ' - '} : ' - '}
</span> </span>
)} )}
......
...@@ -62,6 +62,8 @@ export function getAllQueryParams() { ...@@ -62,6 +62,8 @@ export function getAllQueryParams() {
: '' : ''
params.outputCurrency = isAddress(getQueryParam(window.location, 'outputCurrency')) params.outputCurrency = isAddress(getQueryParam(window.location, 'outputCurrency'))
? getQueryParam(window.location, 'outputCurrency') ? getQueryParam(window.location, 'outputCurrency')
: getQueryParam(window.location, 'outputCurrency') === 'ETH'
? 'ETH'
: '' : ''
params.slippage = !isNaN(getQueryParam(window.location, 'slippage')) ? getQueryParam(window.location, 'slippage') : '' params.slippage = !isNaN(getQueryParam(window.location, 'slippage')) ? getQueryParam(window.location, 'slippage') : ''
params.exactField = getQueryParam(window.location, 'exactField') params.exactField = getQueryParam(window.location, 'exactField')
......
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