From 592140158b6009613470b8faf682558e74765e84 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Tue, 30 Jun 2020 14:18:51 +0100 Subject: [PATCH] some comments.. --- .../src/pages/[application]/backend/model/_layout.svelte | 2 ++ .../builder/src/pages/[application]/backend/model/index.svelte | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/builder/src/pages/[application]/backend/model/_layout.svelte b/packages/builder/src/pages/[application]/backend/model/_layout.svelte index 7f36f26d22..ee17644f3a 100644 --- a/packages/builder/src/pages/[application]/backend/model/_layout.svelte +++ b/packages/builder/src/pages/[application]/backend/model/_layout.svelte @@ -8,6 +8,8 @@ } onMount(async () => { + // navigate to first model in list, if not already selected + // and this is the final url (i.e. no selectedModel) if (!$leftover && $backendUiStore.models.length > 0 && (!$backendUiStore.selectedModel || !$backendUiStore.selectedModel._id)) { $goto(`./${$backendUiStore.models[0]._id}`) } diff --git a/packages/builder/src/pages/[application]/backend/model/index.svelte b/packages/builder/src/pages/[application]/backend/model/index.svelte index da83f587f5..15a08b1d09 100644 --- a/packages/builder/src/pages/[application]/backend/model/index.svelte +++ b/packages/builder/src/pages/[application]/backend/model/index.svelte @@ -8,7 +8,10 @@ } onMount(async () => { + // navigate to first model in list, if not already selected + // and this is the final url (i.e. no selectedModel) if (!$leftover && $backendUiStore.models.length > 0 && (!$backendUiStore.selectedModel || !$backendUiStore.selectedModel._id)) { + // this file routes as .../models/index, so, go up one. $goto(`../${$backendUiStore.models[0]._id}`) } })