fix loading state

This commit is contained in:
Peter Clement 2022-10-25 16:22:29 +01:00
parent 208c15bc57
commit 2fd8ec363f
1 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@
let startDate = null let startDate = null
let endDate = null let endDate = null
let filters = getFilters() let filters = getFilters()
let loaded = false
$: page = $pageInfo.page $: page = $pageInfo.page
$: fetchBackups(filterOpt, page, startDate, endDate) $: fetchBackups(filterOpt, page, startDate, endDate)
@ -161,7 +161,10 @@
onMount(() => { onMount(() => {
fetchBackups(filterOpt, page, startDate, endDate) fetchBackups(filterOpt, page, startDate, endDate)
loaded = true
}) })
$: console.log(loaded)
$: console.log(backups.length)
</script> </script>
<div class="root"> <div class="root">
@ -207,7 +210,7 @@
</div> </div>
</Layout> </Layout>
</Page> </Page>
{:else if backupData?.length === 0 && !filterOpt && !startDate} {:else if backupData?.length === 0 && !loaded && !filterOpt && !startDate}
<Page wide={false}> <Page wide={false}>
<div class="align"> <div class="align">
<img <img
@ -227,7 +230,7 @@
</Layout> </Layout>
</div> </div>
</Page> </Page>
{:else} {:else if loaded}
<Layout noPadding gap="M" alignContent="start"> <Layout noPadding gap="M" alignContent="start">
<div class="search"> <div class="search">
<div class="select"> <div class="select">