From 3b2d4419eef426f01450804da170bef082047b5e Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Tue, 30 May 2023 17:27:17 +0200 Subject: [PATCH] fix(frontend): Fix app table actions (#1665) * fix(frontend): Fix app table actions * fix(frontend): Fix app table actions * fix(frontend): Fix app table actions --- .../apps/components/display/table/AppTable.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/table/AppTable.svelte b/frontend/src/lib/components/apps/components/display/table/AppTable.svelte index 79415b3e64..dbc90fa951 100644 --- a/frontend/src/lib/components/apps/components/display/table/AppTable.svelte +++ b/frontend/src/lib/components/apps/components/display/table/AppTable.svelte @@ -72,7 +72,11 @@ let selectedRowIndex = -1 function toggleRow(row: Record, rowIndex: number, force: boolean = false) { - if (selectedRowIndex !== rowIndex || force) { + if ( + selectedRowIndex !== rowIndex || + JSON.stringify(row.original) !== JSON.stringify(result?.[rowIndex]) || + force + ) { selectedRowIndex = rowIndex outputs?.selectedRow.set(row.original, force) outputs?.selectedRowIndex.set(rowIndex, force) @@ -161,8 +165,10 @@ }) } table = createSvelteTable(options) + if (result) { - toggleRow({ original: result[0] }, 0, true) + //console.log('rerendering table', result[0]) + toggleRow({ original: filteredResult[0] }, 0, true) } if (outputs.page.peak()) {