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:
parent
0a01c0e260
commit
b8fc1ae671
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ const mapStateToProps = (state) => {
|
|||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
const mapDispatchToProps = (dispatch) => {
|
||||||
return {
|
return {
|
||||||
onPreferenceToggle: (value) => dispatch(toggleCurrencySwitch(value)),
|
onPreferenceToggle: () => dispatch(toggleCurrencySwitch()),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
@ -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';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user