diff --git a/src/App.svelte b/src/App.svelte index 0b21292..fa67410 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -37,18 +37,30 @@ let selectedCalendars; - onMount(async () => { + async function reloadEvents(selectedCalendars, options) { const evts = await refreshEvents(selectedCalendars); - options.events = evts.flat(); + return evts.flat(); + } + + + onMount(async () => { + options.events = await reloadEvents(selectedCalendars, options); options = { ...options }; }); + + $: { + reloadEvents(selectedCalendars, options).then(events => { + options.events = events; + options = { ...options }; + }); + }