diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8a15e554..f91654d7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,6 +2,12 @@ import logo from '$lib/assets/logo.svg'; import Searchbox from '$lib/components/Searchbox.svelte'; let query = ''; + + import type { Snapshot } from './$types'; + export const snapshot: Snapshot = { + capture: () => query, + restore: (value) => (query = value) + }; Hearchco diff --git a/src/routes/search/+page.svelte b/src/routes/search/+page.svelte index f4420e1b..ded2326a 100644 --- a/src/routes/search/+page.svelte +++ b/src/routes/search/+page.svelte @@ -6,16 +6,24 @@ import type { PageData } from './$types'; export let data: PageData; + let query = data.query; + + import type { Snapshot } from './$types'; + export const snapshot: Snapshot = { + capture: () => query, + restore: (value) => (query = value) + }; Search | Hearchco -
+
{#await data.streamed.results} {:then results} +
{#each results as result (result.URL)}