diff --git a/src/components/Table/sorting.js b/src/components/Table/sorting.js index c537b410..aad73260 100644 --- a/src/components/Table/sorting.js +++ b/src/components/Table/sorting.js @@ -12,7 +12,6 @@ export const buildOrderFieldFrom = (attr: string) => `${attr}Order` const desc = (a: Object, b: Object, orderBy: string, orderProp: boolean) => { const order = orderProp ? buildOrderFieldFrom(orderBy) : orderBy - console.log(a, b, orderBy, orderProp) if (b[order] < a[order]) { return -1 @@ -25,13 +24,14 @@ const desc = (a: Object, b: Object, orderBy: string, orderProp: boolean) => { } // eslint-disable-next-line -export const stableSort = (dataArray: List, cmp: any, fixed: boolean): Array => { +export const stableSort = (dataArray: List, cmp: any, fixed: boolean): List => { const fixedElems: List = fixed ? dataArray.filter((elem: any) => elem.fixed) : List([]) const data: List = fixed ? dataArray.filter((elem: any) => !elem[FIXED]) : dataArray - const stabilizedThis = data.map((el, index) => [el, index]) + let stabilizedThis = data.map((el, index) => [el, index]) - stabilizedThis.sort((a, b) => { + stabilizedThis = stabilizedThis.sort((a, b) => { const order = cmp(a[0], b[0]) + if (order !== 0) { return order } diff --git a/src/routes/safe/components/Balances/dataFetcher.js b/src/routes/safe/components/Balances/dataFetcher.js index 5d955e3c..a601c553 100644 --- a/src/routes/safe/components/Balances/dataFetcher.js +++ b/src/routes/safe/components/Balances/dataFetcher.js @@ -30,7 +30,7 @@ export const getBalanceData = (activeTokens: List): List => { export const generateColumns = () => { const assetColumn: Column = { id: BALANCE_TABLE_ASSET_ID, - order: false, + order: true, disablePadding: false, label: 'Asset', custom: false,