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
// Wipe filter whenever table ID changes to avoid using stale filters
definition.subscribe(() => {
if (get(datasource)?.type !== "table") {
datasource.subscribe($datasource => {
if ($datasource?.type !== "table") {
return
}
filter.set([])