From 3278aab28ff3767242723c02a42654aa211dfc78 Mon Sep 17 00:00:00 2001 From: koalasat Date: Mon, 25 Nov 2024 14:30:24 +0100 Subject: [PATCH] It was the other way around --- frontend/src/components/BookTable/BookControl.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/BookTable/BookControl.tsx b/frontend/src/components/BookTable/BookControl.tsx index 5dbef29d..ca119b39 100644 --- a/frontend/src/components/BookTable/BookControl.tsx +++ b/frontend/src/components/BookTable/BookControl.tsx @@ -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 });