From 90571dd4c5cbc6cba2cee83e62be729ba6001e97 Mon Sep 17 00:00:00 2001 From: Stefan Buhrmester Date: Fri, 23 Jun 2023 15:03:33 +0200 Subject: [PATCH] preserve frames through navigation --- packages/svelte/src/Frame.svelte | 2 +- packages/svelte/src/createInertiaApp.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/Frame.svelte b/packages/svelte/src/Frame.svelte index ff8d085e0..8e9deb310 100755 --- a/packages/svelte/src/Frame.svelte +++ b/packages/svelte/src/Frame.svelte @@ -11,7 +11,7 @@ setContext('inertia:frame-id', id) $: components = $store.frames?.[id] && h($store.frames[id].component.default, $store.frames[id].props) - + onMount(() => { router.visit(src, { target: id diff --git a/packages/svelte/src/createInertiaApp.js b/packages/svelte/src/createInertiaApp.js index c2b8224ec..764b58c4f 100644 --- a/packages/svelte/src/createInertiaApp.js +++ b/packages/svelte/src/createInertiaApp.js @@ -28,6 +28,7 @@ export default async function createInertiaApp({ id = 'app', resolve, setup, pro else store.update((current) => ({ component, page, + frames: current.frames, key: preserveState ? current.key : Date.now(), })) },