diff --git a/components/AssignedCrew.vue b/components/AssignedCrew.vue index 3d7fc0d..c276009 100644 --- a/components/AssignedCrew.vue +++ b/components/AssignedCrew.vue @@ -5,7 +5,7 @@ id !== account.id)" + @click="assignedIds = new Set([...assignedIds].filter(id => id !== account.id))" > x @@ -26,9 +26,9 @@ defineProps<{ }>(); const { data: accounts } = useAccounts(); const accountsById = computed(() => new Map(accounts.value?.map?.(a => [a.id, a]))); -const assignedIds = defineModel({ required: true }); +const assignedIds = defineModel>({ required: true }); const assigned = computed( - () => assignedIds.value.map( + () => [...assignedIds.value].map( id => accountsById.value.get(id) ?? { id, name: String(id) } ) ); @@ -43,8 +43,8 @@ function addCrew() { return; const account = crewByName.value.get(addName.value); if (account) { - if (!assignedIds.value.some(id => id === account.id)) { - assignedIds.value = [...assignedIds.value, account.id]; + if (!assignedIds.value.has(account.id)) { + assignedIds.value = new Set([...assignedIds.value, account.id]); } else { alert(`${addName.value} has already been added`); } diff --git a/components/EventCard.vue b/components/EventCard.vue index b0345e7..875abab 100644 --- a/components/EventCard.vue +++ b/components/EventCard.vue @@ -1,10 +1,5 @@ - - - Error: Unexpected deleted event. - - - + {{ event.name }} {{ event.description ?? "No description provided" }} @@ -14,7 +9,7 @@ slot.id))" + @click="toggle('event', event.id, [...event.slots.keys()])" > {{ accountStore.interestedEventIds.has(event.id) ? "✔ interested" : "🔔 interested?" }} @@ -22,10 +17,10 @@ Timeslots - + {{ formatTime(slot.start) }} - {{ formatTime(slot.end) }} Crew: - {{ slot.assigned.map(id => idToAccount.get(id)?.name).join(", ") }} + {{ [...slot.assigned].map(id => idToAccount.get(id)?.name).join(", ") }} @@ -47,18 +42,17 @@
- Error: Unexpected deleted event. -
{{ event.description ?? "No description provided" }}
@@ -14,7 +9,7 @@ slot.id))" + @click="toggle('event', event.id, [...event.slots.keys()])" > {{ accountStore.interestedEventIds.has(event.id) ? "✔ interested" : "🔔 interested?" }} @@ -22,10 +17,10 @@
Crew: - {{ slot.assigned.map(id => idToAccount.get(id)?.name).join(", ") }} + {{ [...slot.assigned].map(id => idToAccount.get(id)?.name).join(", ") }}