mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-27 01:50:44 +00:00
Fix duplicated values when fixed sorting
This commit is contained in:
parent
70dd3767b4
commit
20d9ca92f9
@ -23,7 +23,8 @@ const desc = (a: Object, b: Object, orderBy: string, orderProp: boolean) => {
|
||||
|
||||
export const stableSort = (array: any, cmp: any, fixed: boolean) => {
|
||||
const fixedElems = fixed ? array.filter(elem => elem[FIXED]) : []
|
||||
const stabilizedThis = array.map((el, index) => [el, index])
|
||||
const data = fixed ? array.filter(elem => !elem[FIXED]) : array
|
||||
const stabilizedThis = data.map((el, index) => [el, index])
|
||||
|
||||
stabilizedThis.sort((a, b) => {
|
||||
const order = cmp(a[0], b[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user