Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit a997e1e

Browse files
myan9starpit
authored andcommitted
fix: LivePaginatedTable implements WatchPusher's update incorrectly
Fixes #7203
1 parent 0918b71 commit a997e1e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/core/src/core/jobs/watchable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface WatchPusher {
4444
* update should be visualized as a change to the model [default:
4545
* true]
4646
*/
47-
update: (response: Row, batch?: boolean, changed?: boolean) => void
47+
update: (response: Row, batch?: boolean, changed?: boolean, idxToUpdate?: number) => void
4848

4949
/** set table body */
5050
setBody: (response: Row[]) => void

plugins/plugin-client-common/src/components/Content/Table/LivePaginatedTable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default class LivePaginatedTable extends PaginatedTable<LiveProps, LiveSt
169169
const foundIndex = lookup(this.props.response.body, newKuiRow)
170170
if (foundIndex === -1 || !sameRow(newKuiRow, this.props.response.body[foundIndex])) {
171171
doUpdate = true
172-
this.update(newKuiRow, true, foundIndex)
172+
this.update(newKuiRow, true, undefined, foundIndex)
173173
}
174174
})
175175

@@ -226,7 +226,8 @@ export default class LivePaginatedTable extends PaginatedTable<LiveProps, LiveSt
226226
* update consumes the update notification and apply it to the table view
227227
*
228228
*/
229-
private update(newKuiRow: KuiRow, batch = false, idxToUpdate?: number) {
229+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
230+
private update(newKuiRow: KuiRow, batch = false, justUpdated = true, idxToUpdate?: number) {
230231
if (!this.props.response.header) {
231232
const header = kuiHeaderFromBody([newKuiRow])
232233
if (header) {

0 commit comments

Comments
 (0)