Viewer: Finally fix Carousel navigation depending on URL
- Instead of detecting every case using popState event or whatnot, used a Sapper page stores subscribe to go to the current photo from the URL param (findIndex in photos) - No page transition when navigating between photos in Viewer, but runs In and Out - Also shortened dispatches to direct value over an object
This commit is contained in:
@@ -22,9 +22,7 @@
|
||||
photosToAppend.forEach(photo => photo.hidden = false)
|
||||
|
||||
// Merge new photos to show to the existing ones
|
||||
dispatch('updatePagination', {
|
||||
paginatedPhotos: [...paginatedPhotos, ...photosToAppend]
|
||||
})
|
||||
dispatch('updatePagination', [...paginatedPhotos, ...photosToAppend])
|
||||
|
||||
// Increment current index
|
||||
currentIndex = currentIndex + photosPerPage
|
||||
|
||||
Reference in New Issue
Block a user