Update normal user home screen to reflect changes with app fetching

This commit is contained in:
Andrew Kingston 2021-05-21 11:17:23 +01:00
parent 613841e7dd
commit 93d77d058c
1 changed files with 6 additions and 4 deletions

View File

@ -26,9 +26,11 @@
onMount(async () => {
await organisation.init()
await apps.load(AppStatus.DEV)
await apps.load()
loaded = true
})
$: publishedApps = $apps.filter(app => app.status === AppStatus.DEPLOYED)
</script>
{#if $auth.user && loaded}
@ -71,17 +73,17 @@
</ActionMenu>
</div>
<Divider />
{#if $apps.length}
{#if publishedApps.length}
<Heading>Apps</Heading>
<div class="group">
<Layout gap="S" noPadding>
{#each $apps as app, idx (app.appId)}
{#each publishedApps as app, idx (app.appId)}
<a class="app" target="_blank" href={`/${app.appId}`}>
<div class="preview" use:gradient={{ seed: app.name }} />
<div class="app-info">
<Heading size="XS">{app.name}</Heading>
<Body size="S">
Edited {Math.round(Math.random() * 10 + 1)} months ago
Updated {Math.round(Math.random() * 10 + 1)} months ago
</Body>
</div>
<Icon name="ChevronRight" />