Skip to content

Commit

Permalink
Merge pull request #151 from satisfactorymodding/staging
Browse files Browse the repository at this point in the history
fix: don't allow to select same tag multiple times
  • Loading branch information
Vilsol authored Jan 7, 2024
2 parents 7b75d64 + db2aaad commit 1f0b08c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/components/utils/TagList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
$: allTags =
$getAllTags.data?.getTags?.map((t) => ({
label: `${t.name} - ${t.description}`,
value: t.id
value: t.id,
name: t.name
})) || ([] satisfies AutocompleteOption[]);
const popupSettings: PopupSettings = {
Expand Down Expand Up @@ -85,7 +86,7 @@
<div class="card max-h-48 w-max max-w-full overflow-y-auto p-4" tabindex="-1" data-popup="popupAutocomplete">
<Autocomplete
bind:input={inputTag}
options={allTags.filter((t) => tagList.indexOf(t.label) < 0)}
options={allTags.filter((t) => tagList.indexOf(t.name) < 0)}
on:selection={(t) => addTag(t.detail)} />
</div>
{/if}
Expand Down

0 comments on commit 1f0b08c

Please sign in to comment.