From 005b7be2e7d90cb98e36dedd03134412648366fe Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Wed, 16 Oct 2024 17:29:36 -0400 Subject: [PATCH] fixup! fix: allow adding self to shared event Signed-off-by: SebastianKrupinski --- src/components/Editor/Invitees/InviteesList.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Editor/Invitees/InviteesList.vue b/src/components/Editor/Invitees/InviteesList.vue index 4ba63f506..b3b199665 100644 --- a/src/components/Editor/Invitees/InviteesList.vue +++ b/src/components/Editor/Invitees/InviteesList.vue @@ -255,8 +255,13 @@ export default { alreadyInvitedEmails() { const emails = this.invitees.map(attendee => removeMailtoPrefix(attendee.uri)) - if (this.calendarObjectInstance.organizer.uri) { - emails.push(removeMailtoPrefix(this.calendarObjectInstance.organizer.uri)) + // A user should be able to invite themselves if they are not the organizer + const principal = this.principalsStore.getCurrentUserPrincipal + const organizerUri = this.calendarObjectInstance.organizer?.uri + if (organizerUri) { + emails.push(removeMailtoPrefix(organizerUri)) + } else if (principal) { + emails.push(principal.emailAddress) } return emails