Better fallbacks for data fetching
parent
ad4dcb3147
commit
97edcf81da
|
@ -346,7 +346,12 @@ class LogsTable extends Component<Props, State> {
|
|||
}
|
||||
|
||||
const data = getValuesFromData(this.props.tableInfiniteData.forward)
|
||||
const firstTime = getDeep(data, '0.0', new Date().getTime() / 1000)
|
||||
const backwardData = getValuesFromData(this.props.tableInfiniteData.forward)
|
||||
const firstTime = getDeep(
|
||||
data,
|
||||
'0.0',
|
||||
getDeep(backwardData, '0.0', new Date().getTime())
|
||||
)
|
||||
const {firstQueryTime} = this.state
|
||||
if (firstQueryTime && firstQueryTime > firstTime) {
|
||||
return
|
||||
|
@ -364,11 +369,12 @@ class LogsTable extends Component<Props, State> {
|
|||
}
|
||||
|
||||
const data = getValuesFromData(this.props.tableInfiniteData.backward)
|
||||
const forwardData = getValuesFromData(this.props.tableInfiniteData.forward)
|
||||
|
||||
const lastTime = getDeep(
|
||||
data,
|
||||
`${data.length - 1}.0`,
|
||||
new Date().getTime() / 1000
|
||||
getDeep(forwardData, `${forwardData.length - 1}.0`, new Date().getTime())
|
||||
)
|
||||
|
||||
// Guard against fetching on scrolling back up then down
|
||||
|
|
Loading…
Reference in New Issue