aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/+page.svelte7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index a395658..57f912d 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -20,10 +20,9 @@
const key = item.categoryName ?? 'Non catégorisé';
(groups[key] ??= []).push(item);
}
- const result: [string, typeof localItems][] = data.categories.map((cat) => [
- cat.name,
- groups[cat.name] ?? [],
- ]);
+ const result: [string, typeof localItems][] = data.categories
+ .filter((cat) => groups[cat.name]?.length > 0)
+ .map((cat) => [cat.name, groups[cat.name]]);
if (groups['Non catégorisé']?.length > 0) {
result.push(['Non catégorisé', groups['Non catégorisé']]);
}