diff --git a/plugins/contact-resources/src/components/CreateEmployee.svelte b/plugins/contact-resources/src/components/CreateEmployee.svelte index 85903a78e6..591d0e4040 100644 --- a/plugins/contact-resources/src/components/CreateEmployee.svelte +++ b/plugins/contact-resources/src/components/CreateEmployee.svelte @@ -22,6 +22,9 @@ import contact from '../plugin' import PersonPresenter from './PersonPresenter.svelte' + export let canSave: boolean = true + export let onCreate: ((id: Ref) => Promise) | undefined = undefined + let avatarEditor: EditableAvatar let firstName = '' @@ -66,6 +69,9 @@ provider: channel.provider }) } + if (onCreate) { + await onCreate(id) + } dispatch('close') } @@ -102,7 +108,11 @@ 0 && lastName.trim().length > 0 && matches.length === 0 && email.trim().length > 0} + canSave={firstName.trim().length > 0 && + lastName.trim().length > 0 && + matches.length === 0 && + email.trim().length > 0 && + canSave} on:close={() => { dispatch('close') }} @@ -142,6 +152,7 @@ on:blur={changeEmail} /> +