Fix table selection not working when on datasource page

This commit is contained in:
Andrew Kingston 2023-04-18 08:55:54 +01:00
parent 140729b1d7
commit ffd3e5d008
1 changed files with 8 additions and 1 deletions

View File

@ -13,6 +13,13 @@
$: sortedTables = $tables.list
.filter(table => table.sourceId === sourceId)
.sort(alphabetical)
const selectTable = tableId => {
tables.select(tableId)
if (!$isActive("./table/:tableId")) {
$goto(`./table/${tableId}`)
}
}
</script>
{#if $database?._id}
@ -25,7 +32,7 @@
text={table.name}
selected={$isActive("./table/:tableId") &&
$tables.selected?._id === table._id}
on:click={() => tables.select(table._id)}
on:click={() => selectTable(table._id)}
>
{#if table._id !== TableNames.USERS}
<EditTablePopover {table} />