diff --git a/src/components/ImageGenerator.svelte b/src/components/ImageGenerator.svelte index 0b10c80..36979f8 100644 --- a/src/components/ImageGenerator.svelte +++ b/src/components/ImageGenerator.svelte @@ -33,7 +33,7 @@ const events = { let searchParams = null let imageSelected = Object.keys(images)[0]; //let eventSelected = core.events[0].id; -const eventSelected = writable(Object.keys(events)[0]); +const eventSelected = writable(''); const speakerSelected = writable('alona-shevchenko'); onMount(() => { @@ -48,6 +48,9 @@ onMount(() => { eventSelected.subscribe((id, next) => { const event = core.events.find(e => e.id === id); + if (!event) { + return; + } if (event.speakers?.length > 0) { speakerSelected.set(event.speakers[0]); } @@ -66,8 +69,9 @@ $: speaker = core.people.find(p => p.id === $speakerSelected);