diff --git a/plugins/calendar-resources/src/components/LocationEditor.svelte b/plugins/calendar-resources/src/components/LocationEditor.svelte index 332ba7d3a0..b579971b16 100644 --- a/plugins/calendar-resources/src/components/LocationEditor.svelte +++ b/plugins/calendar-resources/src/components/LocationEditor.svelte @@ -4,14 +4,14 @@ export let value: string | undefined - function isLink (value: string | undefined): boolean { - if (value === undefined) return false + function isLink (value?: string | null): boolean { + if (value == null) return false const url = parseURL(value) return url.startsWith('http://') || url.startsWith('https://') } function open () { - if (value === undefined) return + if (value == null) return const url = parseURL(value) if (url.startsWith('http://') || url.startsWith('https://')) { window.open(url, '_blank') diff --git a/plugins/calendar-resources/src/utils.ts b/plugins/calendar-resources/src/utils.ts index d5de702a3c..337313b3d5 100644 --- a/plugins/calendar-resources/src/utils.ts +++ b/plugins/calendar-resources/src/utils.ts @@ -19,11 +19,11 @@ export function saveUTC (date: Timestamp): Timestamp { ) } -export function hidePrivateEvents (events: Event[], calendars: IdMap): Event[] { +export function hidePrivateEvents (events: Event[], calendars: IdMap, allowMe: boolean = true): Event[] { const me = getCurrentAccount()._id const res: Event[] = [] for (const event of events) { - if ((event.createdBy ?? event.modifiedBy) === me) { + if ((event.createdBy ?? event.modifiedBy) === me && allowMe) { res.push(event) } else { if (event.visibility !== undefined) {