Skip to content

Commit

Permalink
Fixed the infinite loading of the live trade history
Browse files Browse the repository at this point in the history
  • Loading branch information
LeifuChen committed Jul 31, 2023
1 parent 39154b4 commit e54b28b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/app/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getSortedRowModel,
} from '@tanstack/react-table'
import type { ColumnDef, Row, SortingState, VisibilityState } from '@tanstack/react-table'
import React, { DependencyList, FC, useCallback, useMemo, useRef, useState } from 'react'
import React, { DependencyList, FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import styled, { css } from 'styled-components'
import { genericMemo } from 'types/helpers'

Expand Down Expand Up @@ -141,6 +141,10 @@ const Table = <T,>({
[onTableRowClick]
)

useEffect(() => {
lastRef(defaultRef.current)
}, [lastRef, defaultRef, data.length])

return (
<>
<TableContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const TableAlignment = css`

const StyledTable = styled(Table)`
border: none;
height: 100%;
overflow-y: auto;
.table-row,
.table-body-row {
Expand Down

0 comments on commit e54b28b

Please sign in to comment.