Store previous page for photo Viewer close button
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import '../style/style.scss'
|
||||
import { navigating, page } from '$app/stores'
|
||||
import { onMount, setContext } from 'svelte'
|
||||
import { pageLoading } from '$utils/stores'
|
||||
import { pageLoading, previousPage } from '$utils/stores'
|
||||
import { scrollToTop } from '$utils/functions'
|
||||
import { DURATION } from '$utils/contants'
|
||||
import '$utils/polyfills'
|
||||
@@ -24,6 +24,14 @@
|
||||
/**
|
||||
* On page change
|
||||
*/
|
||||
// Store previous page (for photo Viewer close button)
|
||||
let previous = ''
|
||||
page.subscribe(value => {
|
||||
$previousPage = previous
|
||||
previous = value.path
|
||||
})
|
||||
|
||||
// Define page loading from navigating store
|
||||
navigating.subscribe((store: any) => {
|
||||
if (store) {
|
||||
$pageLoading = true
|
||||
|
||||
Reference in New Issue
Block a user