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