diff --git a/ui/components/app/currency-input/currency-input.js b/ui/components/app/currency-input/currency-input.js index 640467c30..a87393d4a 100644 --- a/ui/components/app/currency-input/currency-input.js +++ b/ui/components/app/currency-input/currency-input.js @@ -87,7 +87,7 @@ export default function CurrencyInput({ }, [hexValue]); const swap = async () => { - await onPreferenceToggle(!featureSecondary); + await onPreferenceToggle(); setSwapped(!isSwapped); }; diff --git a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js index 7ccd78642..042b73c24 100644 --- a/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js +++ b/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js @@ -14,7 +14,7 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { return { - onPreferenceToggle: (value) => dispatch(toggleCurrencySwitch(value)), + onPreferenceToggle: () => dispatch(toggleCurrencySwitch()), }; }; diff --git a/ui/ducks/app/app.js b/ui/ducks/app/app.js index 228b3eb5b..1f6081343 100644 --- a/ui/ducks/app/app.js +++ b/ui/ducks/app/app.js @@ -381,10 +381,10 @@ export default function reduceApp(state = {}, action) { ...appState, ledgerTransportStatus: action.value, }; - case actionConstants.SET_CURRENCY_INPUT_SWITCH: + case actionConstants.TOGGLE_CURRENCY_INPUT_SWITCH: return { ...appState, - sendInputCurrencySwitched: action.value, + sendInputCurrencySwitched: !appState.sendInputCurrencySwitched, }; default: return appState; @@ -434,6 +434,6 @@ export function getLedgerTransportStatus(state) { return state.appState.ledgerTransportStatus; } -export function toggleCurrencySwitch(value) { - return { type: actionConstants.SET_CURRENCY_INPUT_SWITCH, value }; +export function toggleCurrencySwitch() { + return { type: actionConstants.TOGGLE_CURRENCY_INPUT_SWITCH }; } diff --git a/ui/store/actionConstants.js b/ui/store/actionConstants.js index 0bc5b5c80..1e426daea 100644 --- a/ui/store/actionConstants.js +++ b/ui/store/actionConstants.js @@ -113,4 +113,4 @@ export const SET_SMART_TRANSACTIONS_ERROR = 'SET_SMART_TRANSACTIONS_ERROR'; export const DISMISS_SMART_TRANSACTIONS_ERROR_MESSAGE = 'DISMISS_SMART_TRANSACTIONS_ERROR_MESSAGE'; -export const SET_CURRENCY_INPUT_SWITCH = 'SET_CURRENCY_INPUT_SWITCH'; +export const TOGGLE_CURRENCY_INPUT_SWITCH = 'TOGGLE_CURRENCY_INPUT_SWITCH';