mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Fix currency toggle (#13813)
This commit is contained in:
parent
0a01c0e260
commit
b8fc1ae671
@ -87,7 +87,7 @@ export default function CurrencyInput({
|
||||
}, [hexValue]);
|
||||
|
||||
const swap = async () => {
|
||||
await onPreferenceToggle(!featureSecondary);
|
||||
await onPreferenceToggle();
|
||||
setSwapped(!isSwapped);
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ const mapStateToProps = (state) => {
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
onPreferenceToggle: (value) => dispatch(toggleCurrencySwitch(value)),
|
||||
onPreferenceToggle: () => dispatch(toggleCurrencySwitch()),
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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 };
|
||||
}
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user