Skip to content

Commit

Permalink
fix(console): prevent dead loop when list datastore tables (#3053)
Browse files Browse the repository at this point in the history
  • Loading branch information
jialeicui authored Dec 4, 2023
1 parent 7b5a000 commit b6fc2d5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export function useFetchDatastoreAllTables(
const allTables = useListDatastoreTables(params, !!params)

const tables = React.useMemo(() => {
return allTables.data?.tables?.sort((a, b) => (a > b ? 1 : -1)) ?? []
}, [allTables])
const _tables = allTables.data?.tables ?? []
return [..._tables].sort((a, b) => (a > b ? 1 : -1))
}, [allTables.data])

return {
isSuccess: allTables.isSuccess,
Expand Down

0 comments on commit b6fc2d5

Please sign in to comment.