Compare commits

..

3 Commits

Author SHA1 Message Date
Levente Orban
69a760d3f1 Merge pull request #23 from polaroi8d/fix/windows-not-defined
fix: windows not defined in SSR
2025-09-24 20:21:34 +02:00
Levente Orban
a59bc3601c fix: windows not defined in SSR 2025-09-24 20:18:52 +02:00
Levente Orban
b64d48a933 chore:readme-icall-feature
chore: add ical feature to readme
2025-09-18 11:23:56 +02:00

View File

@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores'; import { page } from '$app/stores';
import { browser } from '$app/environment';
import type { Event, RSVP } from '$lib/types'; import type { Event, RSVP } from '$lib/types';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { enhance } from '$app/forms'; import { enhance } from '$app/forms';
@@ -28,13 +29,13 @@
$: currentUserId = data.userId; $: currentUserId = data.userId;
// Create calendar event object when event data changes // Create calendar event object when event data changes
$: if (event) { $: if (event && browser) {
calendarEvent = { calendarEvent = {
name: event.name, name: event.name,
date: event.date, date: event.date,
time: event.time, time: event.time,
location: event.location, location: event.location,
url: `${window.location.origin}/event/${eventId}` url: `${$page.url.origin}/event/${eventId}`
}; };
} }
@@ -56,13 +57,15 @@
const eventId = $page.params.id || ''; const eventId = $page.params.id || '';
const copyEventLink = () => { const copyEventLink = () => {
const url = `${window.location.origin}/event/${eventId}`; if (browser) {
navigator.clipboard.writeText(url).then(() => { const url = `${$page.url.origin}/event/${eventId}`;
success = 'Event link copied to clipboard!'; navigator.clipboard.writeText(url).then(() => {
setTimeout(() => { success = 'Event link copied to clipboard!';
success = ''; setTimeout(() => {
}, 3000); success = '';
}); }, 3000);
});
}
}; };
const clearMessages = () => { const clearMessages = () => {
@@ -408,12 +411,12 @@
</div> </div>
<!-- Calendar Modal --> <!-- Calendar Modal -->
{#if calendarEvent} {#if calendarEvent && browser}
<CalendarModal <CalendarModal
bind:isOpen={showCalendarModal} bind:isOpen={showCalendarModal}
event={calendarEvent} event={calendarEvent}
{eventId} {eventId}
baseUrl={window.location.origin} baseUrl={$page.url.origin}
on:close={closeCalendarModal} on:close={closeCalendarModal}
/> />
{/if} {/if}