From 07baf5561209b7d538675857bae55f1840c2115e Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 30 Oct 2023 19:13:34 +0100 Subject: [PATCH] fix npm build error --- frontend/main.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/main.ts b/frontend/main.ts index 4cd5700..c578df6 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -171,6 +171,11 @@ interface ChoiceEvent extends Event{ } function initNewChoice(select: HTMLInputElement) { + + let seats = 0; + if (select.dataset && select.dataset.seats) { + seats = +select.dataset.seats; + } const choice = new Choices(select, { removeItemButton: true, loadingText: 'Wird geladen...', @@ -178,7 +183,7 @@ function initNewChoice(select: HTMLInputElement) { noChoicesText: 'Keine Ergebnisse gefunden', itemSelectText: 'Zum Auswählen klicken', placeholderValue: 'Ruderer auswählen', - maxItemCount: select.dataset.seats, + maxItemCount: seats, maxItemText: (maxItemCount) => { return `Nur ${maxItemCount} Ruderer können hinzugefügt werden`; },