Fix hide currency column in book when mode is swaps

This commit is contained in:
Reckless_Satoshi 2023-04-10 10:21:27 -07:00
parent 1ac6e0fa86
commit 9a99e6f1ff
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -249,9 +249,8 @@ const BookTable = ({
};
};
const currencyObj = function (width: number, hide: boolean) {
const currencyObj = function (width: number) {
return {
hide: fav.mode === 'swap' ? true : hide,
field: 'currency',
headerName: t('Currency'),
width: width * fontSize,
@ -602,6 +601,11 @@ const BookTable = ({
let width: number = 0;
for (const [key, value] of Object.entries(columnSpecs)) {
// do not use col currency on swaps
if (fav.mode === 'swap' && key === 'currency') {
continue;
}
const colWidth = useSmall && value.small ? value.small.width : value.normal.width;
const colObject = useSmall && value.small ? value.small.object : value.normal.object;
@ -630,7 +634,7 @@ const BookTable = ({
const [columns, width] = useMemo(() => {
return filteredColumns(fullscreen ? fullWidth : maxWidth);
}, [maxWidth, fullscreen, fullWidth]);
}, [maxWidth, fullscreen, fullWidth, fav.mode]);
const Footer = function () {
return (