From 738e8b1261df7681432172db5d6a0f9ea3b0c08b Mon Sep 17 00:00:00 2001 From: Robin Cussol Date: Mon, 6 Apr 2020 16:06:17 +0200 Subject: [PATCH] fix(examples): hide "undefined" domain in HN example This commit introduces a null-undefined check against the domain of the HN items in the Hacker News example. --- .../examples/21-miscellaneous/01-hacker-news/Item.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/site/content/examples/21-miscellaneous/01-hacker-news/Item.svelte b/site/content/examples/21-miscellaneous/01-hacker-news/Item.svelte index e9cd617e96..f9bcdb4359 100644 --- a/site/content/examples/21-miscellaneous/01-hacker-news/Item.svelte +++ b/site/content/examples/21-miscellaneous/01-hacker-news/Item.svelte @@ -26,7 +26,9 @@

{item.title}

- {item.domain} + {#if item.domain != null} + {item.domain} + {/if}

submitted by {item.user} {item.time_ago} @@ -36,4 +38,4 @@ {#each item.comments as comment} {/each} - \ No newline at end of file +