fix(frontend): Fix AgGrid infinit clear (#3607)

This commit is contained in:
Faton Ramadani
2024-04-24 18:38:36 +02:00
committed by GitHub
parent ec49d63a65
commit 97ca8b5d32

View File

@@ -29,6 +29,18 @@
export let actions: TableAction[] | undefined = undefined
let runnableComponent: RunnableComponent | undefined = undefined
function clear() {
lastComponentInput = componentInput
setTimeout(() => {
aggrid?.clearRows()
}, 0)
}
let lastComponentInput = componentInput
$: JSON.stringify(lastComponentInput) !== JSON.stringify(componentInput) && clear()
const context = getContext<AppViewerContext>('AppViewerContext')
const { app, worldStore } = context
@@ -62,14 +74,6 @@
let aggrid: AppAggridExplorerTable | undefined = undefined
function clear() {
if (componentInput?.type !== 'runnable') {
aggrid?.clearRows()
}
}
$: result && clear()
const datasource: IDatasource = {
rowCount: undefined,