Fix error when leaving Viewer
The carousel would go to a photo that doesn't exists
This commit is contained in:
@@ -121,7 +121,11 @@
|
|||||||
|
|
||||||
// Viewer: Navigate to photo on init and URL change
|
// Viewer: Navigate to photo on init and URL change
|
||||||
if (viewer) {
|
if (viewer) {
|
||||||
page.subscribe(page => goToPhoto(photos.findIndex(photo => photo.slug === page.params.photo)))
|
page.subscribe(page => {
|
||||||
|
if (page.path.includes('/viewer/')) {
|
||||||
|
goToPhoto(photos.findIndex(photo => photo.slug === page.params.photo))
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user