It was the other way around

This commit is contained in:
koalasat 2024-11-25 14:30:24 +01:00
parent 6520c01ca8
commit 3278aab28f
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157

View File

@ -43,9 +43,9 @@ const BookControl = ({
if (fav.type === null) {
setOrderType('any');
} else if (fav.mode === 'fiat') {
setOrderType(fav.type === 0 ? 'buy' : 'sell');
setOrderType(fav.type === 1 ? 'buy' : 'sell');
} else {
setOrderType(fav.type === 0 ? 'swapout' : 'swapin');
setOrderType(fav.type === 1 ? 'swapout' : 'swapin');
}
}, [fav.mode, fav.type]);
@ -62,14 +62,14 @@ const BookControl = ({
const handleOrderTypeChange = (mouseEvent: React.MouseEvent, select: object): void => {
if (select.props.value === 'sell') {
const currency = fav.currency === 1000 ? 0 : fav.currency;
setFav({ ...fav, mode: 'fiat', type: 1, currency });
setFav({ ...fav, mode: 'fiat', type: 0, currency });
} else if (select.props.value === 'buy') {
const currency = fav.currency === 1000 ? 0 : fav.currency;
setFav({ ...fav, mode: 'fiat', type: 0, currency });
setFav({ ...fav, mode: 'fiat', type: 1, currency });
} else if (select.props.value === 'swapin') {
setFav({ ...fav, mode: 'swap', type: 1, currency: 1000 });
} else if (select.props.value === 'swapout') {
setFav({ ...fav, mode: 'swap', type: 0, currency: 1000 });
} else if (select.props.value === 'swapout') {
setFav({ ...fav, mode: 'swap', type: 1, currency: 1000 });
} else {
const currency = fav.currency === 1000 ? 0 : fav.currency;
setFav({ ...fav, mode: 'fiat', type: null, currency });