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

Commit a74884d

Browse files
committed
fix(plugins/plugin-client-common): watch ls does not watch
This has been broken for a while now, and we've been ignoring test failures.
1 parent 5835412 commit a74884d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type LiveProps = Props<KuiTable & Watchable> & { onRender: (hasContent: boolean)
2727

2828
interface LiveState extends State {
2929
isWatching: boolean
30-
lastUpdatedMillis: number
3130
}
3231

3332
export default class LivePaginatedTable extends PaginatedTable<LiveProps, LiveState> {
@@ -295,7 +294,10 @@ export default class LivePaginatedTable extends PaginatedTable<LiveProps, LiveSt
295294
private batchUpdateDone() {
296295
if (this._deferredUpdate) {
297296
this._deferredUpdate = undefined
298-
this.setState({ lastUpdatedMillis: Date.now() })
297+
this.setState(curState => ({
298+
body: curState.body.slice(), // force render
299+
lastUpdatedMillis: Date.now()
300+
}))
299301
}
300302
}
301303

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ export type State<T extends KuiTable = KuiTable> = ToolbarProps &
100100
/* sorting */
101101
activeSortIdx: number
102102
activeSortDir: SortByDirection
103+
104+
lastUpdatedMillis: number
103105
}
104106

105107
export function getBreadcrumbsFromTable(response: KuiTable, prefixBreadcrumbs: BreadcrumbView[]) {
@@ -179,6 +181,7 @@ export default class PaginatedTable<P extends Props, S extends State> extends Re
179181
header,
180182
asSequence,
181183
asHistogram: defaultPresentation === 'histogram',
184+
lastUpdatedMillis: !currentState ? Date.now() : currentState.lastUpdatedMillis,
182185
activeSortIdx: -1,
183186
activeSortDir: undefined,
184187
response: props.response,

0 commit comments

Comments
 (0)