fix undefined check
This commit is contained in:
parent
590c0a0d43
commit
fc5f3e9b08
1 changed files with 14 additions and 14 deletions
|
|
@ -7,11 +7,10 @@
|
||||||
let posts = $derived(data.posts);
|
let posts = $derived(data.posts);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if posts.length === 0}
|
{#if !posts || posts.length === 0}
|
||||||
<h3 class="text-center text-lg font-semibold">Looks like I haven't posted anything yet!</h3>
|
<h3 class="text-center text-lg font-semibold">Looks like I haven't posted anything yet!</h3>
|
||||||
{/if}
|
{:else}
|
||||||
|
<div class="mx-auto grid gap-8 px-3 py-3 sm:px-8 sm:py-4 lg:grid-cols-2">
|
||||||
<div class="mx-auto grid gap-8 px-3 py-3 sm:px-8 sm:py-4 lg:grid-cols-2">
|
|
||||||
{#each posts as post (post.id)}
|
{#each posts as post (post.id)}
|
||||||
<BlogCard
|
<BlogCard
|
||||||
id={post.id}
|
id={post.id}
|
||||||
|
|
@ -22,4 +21,5 @@
|
||||||
topics={post.topics}
|
topics={post.topics}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue