Skip to content

Commit

Permalink
fix: limit order list sorted by creation date
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed Jan 7, 2025
1 parent 531fdab commit 79b1b16
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Order } from '@shapeshiftoss/types'
import { useQueries } from '@tanstack/react-query'
import axios from 'axios'
import { getConfig } from 'config'
import orderBy from 'lodash/orderBy'
import { useCallback } from 'react'
import { mergeQueryOutputs } from 'react-queries/helpers'
import { selectEvmAccountIds } from 'state/slices/common-selectors'
Expand Down Expand Up @@ -49,7 +50,10 @@ export const useGetLimitOrdersQuery = () => {
queryFn: getQueryFn(accountId),
refetchInterval: 15_000,
})),
combine: queries => mergeQueryOutputs(queries, results => results.flat()),
combine: queries =>
mergeQueryOutputs(queries, results =>
orderBy(results.flat(), ({ order }) => order.creationDate, 'desc'),
),
})

return customTokenQueries
Expand Down

0 comments on commit 79b1b16

Please sign in to comment.