This commit is contained in:
tree🌴 2024-03-07 12:31:03 +01:00
parent 8d59253a8d
commit 6a17736be2

View file

@ -47,6 +47,7 @@ let searchParams = null
//let eventSelected = core.events[0].id;
const eventSelected = writable('');
const speakerSelected = writable('alona-shevchenko');
const imageSelected = writable('');
onMount(() => {
searchParams = new URL(document.location).searchParams;
@ -59,6 +60,10 @@ onMount(() => {
if (speaker) {
speakerSelected.set(speaker);
}
const img = searchParams.get('img');
if (img) {
imageSelected.set(img);
}
});
eventSelected.subscribe((id, next) => {
@ -73,7 +78,7 @@ eventSelected.subscribe((id, next) => {
})
function getImage(eId) {
return `/gen-img/events/${events[eId]?.image}.png`
return `/gen-img/events/${$imageSelected ? $imageSelected : events[eId]?.image}.png`
}
$: image = getImage($eventSelected);