Fix table resetting state more often than desired

This commit is contained in:
Andrew Kingston 2023-08-14 11:50:30 +01:00
parent 3b7a5c0392
commit d1b3d033dd
1 changed files with 2 additions and 2 deletions

View File

@ -62,8 +62,8 @@ export const initialise = context => {
const { datasource, fetch, filter, sort, definition } = context const { datasource, fetch, filter, sort, definition } = context
// Wipe filter whenever table ID changes to avoid using stale filters // Wipe filter whenever table ID changes to avoid using stale filters
definition.subscribe(() => { datasource.subscribe($datasource => {
if (get(datasource)?.type !== "table") { if ($datasource?.type !== "table") {
return return
} }
filter.set([]) filter.set([])