Fix: regression in themeslist

This commit is contained in:
Pieter Vander Vennet 2025-04-09 17:11:46 +02:00
parent 01f1fbf89a
commit 347a02778f

View file

@ -14,16 +14,6 @@
export let state: { osmConnection: OsmConnection }
export let onlyIcons: boolean = false
export let hasSelection: boolean = true
let themesFiltered: MinimalThemeInformation[] = []
for (const theme of themes) {
if (!theme) {
continue
}
if (themesFiltered.some(th => th.id === theme.id)) {
continue
}
themesFiltered.push(theme)
}
</script>
<section class="w-full">
@ -33,7 +23,7 @@
? "flex flex-wrap items-center justify-center gap-x-2"
: "theme-list my-2 gap-4 md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3"}
>
{#each Utils.NoNull(themesFiltered) as theme (theme.id)}
{#each Utils.DedupOnId(Utils.NoNull(themes)) as theme (theme.id)}
<ThemeButton {theme} {state} iconOnly={onlyIcons}>
{#if $search && hasSelection && themes?.[0] === theme}
<span class="thanks hidden-on-mobile" aria-hidden="true">