From cd30c45ca5c03dc52f6758840b0b24d2f9d6d936 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 31 Aug 2023 14:50:28 +0100 Subject: [PATCH] Fix for error seen when creating blank screen --- .../src/builderStore/store/screenTemplates/rowListScreen.js | 3 +++ .../design/_components/NewScreen/CreateScreenModal.svelte | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js index 968d6deb4a..54dd38ac63 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js @@ -3,6 +3,9 @@ import { Screen } from "./utils/Screen" import { Component } from "./utils/Component" export default function (datasources) { + if (!Array.isArray(datasources)) { + return [] + } return datasources.map(datasource => { return { name: `${datasource.name} - List`, diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte index dd611041ed..9a96242b30 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte @@ -110,7 +110,7 @@ if (mode === "table") { datasourceModal.show() } else if (mode === "blank") { - let templates = getTemplates($store, $tables.list) + let templates = getTemplates($tables.list) const blankScreenTemplate = templates.find( t => t.id === "createFromScratch" )