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
This commit is contained in:
@@ -72,7 +72,11 @@
|
|||||||
let selectedRowIndex = -1
|
let selectedRowIndex = -1
|
||||||
|
|
||||||
function toggleRow(row: Record<string, any>, rowIndex: number, force: boolean = false) {
|
function toggleRow(row: Record<string, any>, rowIndex: number, force: boolean = false) {
|
||||||
if (selectedRowIndex !== rowIndex || force) {
|
if (
|
||||||
|
selectedRowIndex !== rowIndex ||
|
||||||
|
JSON.stringify(row.original) !== JSON.stringify(result?.[rowIndex]) ||
|
||||||
|
force
|
||||||
|
) {
|
||||||
selectedRowIndex = rowIndex
|
selectedRowIndex = rowIndex
|
||||||
outputs?.selectedRow.set(row.original, force)
|
outputs?.selectedRow.set(row.original, force)
|
||||||
outputs?.selectedRowIndex.set(rowIndex, force)
|
outputs?.selectedRowIndex.set(rowIndex, force)
|
||||||
@@ -161,8 +165,10 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
table = createSvelteTable(options)
|
table = createSvelteTable(options)
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
toggleRow({ original: result[0] }, 0, true)
|
//console.log('rerendering table', result[0])
|
||||||
|
toggleRow({ original: filteredResult[0] }, 0, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs.page.peak()) {
|
if (outputs.page.peak()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user