From 9a141a11ed6b8de153b7d6eac1661c23a2f153fe Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 26 Feb 2025 16:50:05 +0100 Subject: frontend: Use joinText in TagPill We basically already had a function that does what we need here, so there's no need to reimplement it just for TagPill. --- frontend/src/lib/Utils.ts | 2 +- frontend/src/lib/pills/TagPill.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/Utils.ts b/frontend/src/lib/Utils.ts index c0e5b6c..df7dad8 100644 --- a/frontend/src/lib/Utils.ts +++ b/frontend/src/lib/Utils.ts @@ -93,7 +93,7 @@ export function formatListSize(word: string, size: number) { return `${size} ${pluralize(word, size)}`; } -export function joinText(items: string[], separator = ', ') { +export function joinText(items: (string | undefined | null)[], separator = ', ') { return items.filter((i) => i).join(separator); } diff --git a/frontend/src/lib/pills/TagPill.svelte b/frontend/src/lib/pills/TagPill.svelte index c97c722..bbd3c55 100644 --- a/frontend/src/lib/pills/TagPill.svelte +++ b/frontend/src/lib/pills/TagPill.svelte @@ -1,5 +1,6 @@ -- cgit v1.2.3-2-gb3c3