Fix errors being thrown when nesting certain components without picking a datasource

This commit is contained in:
Andrew Kingston 2020-10-14 09:39:49 +01:00
parent 53bbbd2b04
commit f6a388b38a
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@
let rowId let rowId
let errors = {} let errors = {}
$: schema = $store.data && $store.data._table.schema $: schema = $store.data && $store.data._table && $store.data._table.schema
$: fields = schema ? Object.keys(schema) : [] $: fields = schema ? Object.keys(schema) : []
</script> </script>

View File

@ -19,7 +19,7 @@
} }
onMount(async () => { onMount(async () => {
if (table) { if (table && typeof table === "string") {
const tableObj = await fetchTable(table) const tableObj = await fetchTable(table)
row.tableId = table row.tableId = table
row._table = tableObj row._table = tableObj