1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix currency toggle (#13813)

This commit is contained in:
Frederik Bolding 2022-03-02 18:57:46 +01:00 committed by GitHub
parent 0a01c0e260
commit b8fc1ae671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -87,7 +87,7 @@ export default function CurrencyInput({
}, [hexValue]); }, [hexValue]);
const swap = async () => { const swap = async () => {
await onPreferenceToggle(!featureSecondary); await onPreferenceToggle();
setSwapped(!isSwapped); setSwapped(!isSwapped);
}; };

View File

@ -14,7 +14,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
onPreferenceToggle: (value) => dispatch(toggleCurrencySwitch(value)), onPreferenceToggle: () => dispatch(toggleCurrencySwitch()),
}; };
}; };

View File

@ -381,10 +381,10 @@ export default function reduceApp(state = {}, action) {
...appState, ...appState,
ledgerTransportStatus: action.value, ledgerTransportStatus: action.value,
}; };
case actionConstants.SET_CURRENCY_INPUT_SWITCH: case actionConstants.TOGGLE_CURRENCY_INPUT_SWITCH:
return { return {
...appState, ...appState,
sendInputCurrencySwitched: action.value, sendInputCurrencySwitched: !appState.sendInputCurrencySwitched,
}; };
default: default:
return appState; return appState;
@ -434,6 +434,6 @@ export function getLedgerTransportStatus(state) {
return state.appState.ledgerTransportStatus; return state.appState.ledgerTransportStatus;
} }
export function toggleCurrencySwitch(value) { export function toggleCurrencySwitch() {
return { type: actionConstants.SET_CURRENCY_INPUT_SWITCH, value }; return { type: actionConstants.TOGGLE_CURRENCY_INPUT_SWITCH };
} }

View File

@ -113,4 +113,4 @@ export const SET_SMART_TRANSACTIONS_ERROR = 'SET_SMART_TRANSACTIONS_ERROR';
export const DISMISS_SMART_TRANSACTIONS_ERROR_MESSAGE = export const DISMISS_SMART_TRANSACTIONS_ERROR_MESSAGE =
'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';