some comments..

This commit is contained in:
Michael Shanks 2020-06-30 14:18:51 +01:00
parent 6a1e5b9b10
commit 592140158b
2 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,8 @@
} }
onMount(async () => { 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)) { if (!$leftover && $backendUiStore.models.length > 0 && (!$backendUiStore.selectedModel || !$backendUiStore.selectedModel._id)) {
$goto(`./${$backendUiStore.models[0]._id}`) $goto(`./${$backendUiStore.models[0]._id}`)
} }

View File

@ -8,7 +8,10 @@
} }
onMount(async () => { 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)) { 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}`) $goto(`../${$backendUiStore.models[0]._id}`)
} }
}) })