diff --git a/src/components/project/edit/OwnerInfoStep.svelte b/src/components/project/edit/OwnerInfoStep.svelte index e68230d4..a51c7717 100644 --- a/src/components/project/edit/OwnerInfoStep.svelte +++ b/src/components/project/edit/OwnerInfoStep.svelte @@ -18,7 +18,12 @@ let { project: _project, onPublish }: { project: Project; onPublish?: () => void } = $props(); - type ContactEntry = { type: "email" | "phone" | "text"; value: string; preferred: boolean }; + type ContactEntry = { + id: string; + type: "email" | "phone" | "text"; + value: string; + preferred: boolean; + }; let legalEntityType = $state<"individual" | "organization">("individual"); // let prefill = $state(""); @@ -28,8 +33,8 @@ // let country = $state(""); // let teamDescription = $state(""); let privateContacts = $state([ - { type: "email", value: "", preferred: true }, - { type: "phone", value: "", preferred: false }, + { id: crypto.randomUUID(), type: "email", value: "", preferred: true }, + { id: crypto.randomUUID(), type: "phone", value: "", preferred: false }, ]); let preferredIndex = $state(0); let iban = $state(""); @@ -55,7 +60,10 @@ } function addContact() { - privateContacts = [...privateContacts, { type: "text", value: "", preferred: false }]; + privateContacts = [ + ...privateContacts, + { id: crypto.randomUUID(), type: "text", value: "", preferred: false }, + ]; } function deleteContact(i: number) { @@ -216,9 +224,9 @@

- {#each privateContacts as contact, i} + {#each privateContacts as contact, i (contact.id)}
-
touch(`contact-${i}`)}> +
touch(contact.id)}>