diff --git a/src/routes/viewer/[country]/[location]/[photo].svelte b/src/routes/viewer/[country]/[location]/[photo].svelte index 446fe6b..99bcd32 100644 --- a/src/routes/viewer/[country]/[location]/[photo].svelte +++ b/src/routes/viewer/[country]/[location]/[photo].svelte @@ -77,11 +77,11 @@ // On init, send an event to the Carousel component with the photoSlug to set currentIndex and then change the photo // Pop event from browser (prev/next) - // const changedUrl = event => { - // dispatch('changedUrl', { - // location: event.target.location - // }) - // } + const changedUrl = event => { + dispatch('changedUrl', { + currentPhoto: currentPhoto + }) + } /* diff --git a/src/utils/Transition.svelte b/src/utils/Transition.svelte index b5c8865..2cb4de8 100644 --- a/src/utils/Transition.svelte +++ b/src/utils/Transition.svelte @@ -22,20 +22,22 @@ */ let scope let firstLoad = true + let previousPage // 1. Watch page change page.subscribe(page => { - if (!page.params.photo) { - // Run the loader animation (only after first load) - if (!firstLoad && process.browser) { - animateIn(scope) - } - - // TODO: Figure out how to delay the page rendering a little bit before the end of the transition panel ending - - // Set pageReady to false (?) - pageReady.set(false) + // Run the loader animation (only after first load) + if (!firstLoad) { + animateIn(scope) } + + // TODO: Figure out how to delay the page rendering a little bit before the end of the transition panel ending + + // Set pageReady to false (?) + pageReady.set(false) + + // Store current page + previousPage = page }) // 2. Watch when loaded changes