fix(Patches): enable prerendering

This commit is contained in:
Ax333l 2023-07-31 00:45:23 +02:00
parent 0ae8a9b751
commit d403a265fd
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,8 @@
<script lang="ts">
import { building } from '$app/environment';
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { derived, readable, type Readable } from 'svelte/store';
import { page } from '$app/stores';
import type { Patch } from '$lib/types';
@ -20,8 +22,15 @@
const query = createQuery(['patches'], queries.patches);
$: selectedPkg = $page.url.searchParams.get('pkg');
let searchTerm = $page.url.searchParams.get('s');
let searchParams: Readable<URLSearchParams>;
if (building) {
searchParams = readable(new URLSearchParams());
} else {
searchParams = derived(page, ($page) => $page.url.searchParams);
}
$: selectedPkg = $searchParams.get('pkg');
let searchTerm = $searchParams.get('s');
let searchTermFiltered = searchTerm
?.replace(/\./g, '')
.replace(/\s/g, '')

View File

@ -1 +0,0 @@
export const prerender = false;