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 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
|
const {firstQueryTime} = this.state
|
||||||
if (firstQueryTime && firstQueryTime > firstTime) {
|
if (firstQueryTime && firstQueryTime > firstTime) {
|
||||||
return
|
return
|
||||||
|
@ -364,11 +369,12 @@ class LogsTable extends Component<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = getValuesFromData(this.props.tableInfiniteData.backward)
|
const data = getValuesFromData(this.props.tableInfiniteData.backward)
|
||||||
|
const forwardData = getValuesFromData(this.props.tableInfiniteData.forward)
|
||||||
|
|
||||||
const lastTime = getDeep(
|
const lastTime = getDeep(
|
||||||
data,
|
data,
|
||||||
`${data.length - 1}.0`,
|
`${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
|
// Guard against fetching on scrolling back up then down
|
||||||
|
|
Loading…
Reference in New Issue