the size of AuthenticatedLayout is real
This commit is contained in:
parent
441903800f
commit
c12d47b749
2 changed files with 3 additions and 1 deletions
|
@ -8,12 +8,13 @@
|
||||||
|
|
||||||
const searchChanged = () => {
|
const searchChanged = () => {
|
||||||
if ($page.url !== '/search') {
|
if ($page.url !== '/search') {
|
||||||
|
globalState.lastPage = $page.url
|
||||||
router.visit('/search', {
|
router.visit('/search', {
|
||||||
preserveState: true,
|
preserveState: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if ($page.url === '/search' && globalState.searchQuery === '') {
|
if ($page.url === '/search' && globalState.searchQuery === '') {
|
||||||
router.visit('/', {
|
router.visit(globalState.lastPage ?? '/', {
|
||||||
preserveState: true,
|
preserveState: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import type { Snippet } from 'svelte';
|
||||||
export const globalState: {
|
export const globalState: {
|
||||||
title?: Snippet;
|
title?: Snippet;
|
||||||
searchQuery?: string;
|
searchQuery?: string;
|
||||||
|
lastPage?: string;
|
||||||
} = $state({
|
} = $state({
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue