diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index 44e0a972f1..e2ecd0f968 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -141,7 +141,14 @@ {/if} - {#if $loaded} + {#if $error} +
+
There was a problem loading your grid
+
+ {$error} +
+
+ {:else if $loaded}
@@ -171,13 +178,6 @@
- {:else if $error} -
-
There was a problem loading your grid
-
- {$error} -
-
{/if} {#if $loading && !$error}
diff --git a/packages/frontend-core/src/components/grid/stores/rows.js b/packages/frontend-core/src/components/grid/stores/rows.js index 1eafb20756..e6251a5afa 100644 --- a/packages/frontend-core/src/components/grid/stores/rows.js +++ b/packages/frontend-core/src/components/grid/stores/rows.js @@ -94,12 +94,14 @@ export const createActions = context => { datasource.subscribe(async $datasource => { // Unsub from previous fetch if one exists unsubscribe?.() + unsubscribe = null fetch.set(null) instanceLoaded.set(false) loading.set(true) // Abandon if we don't have a valid datasource if (!datasource.actions.isDatasourceValid($datasource)) { + error.set("Datasource is invalid") return }