chore: migrate to SvelteKit app state (#14807)

* chore: migrate to SvelteKit app state

* update package-lock.json
This commit is contained in:
Ben McCann
2024-12-20 15:18:22 -07:00
committed by GitHub
parent a14735846c
commit da70a1e457
11 changed files with 171 additions and 136 deletions

View File

@@ -8,13 +8,13 @@
<script lang="ts">
import { writable, type Writable } from 'svelte/store';
import { createContext } from '$lib/utils/context';
import { page } from '$app/stores';
import { page } from '$app/state';
import { handlePromiseError } from '$lib/utils';
import { goto } from '$app/navigation';
import type { Snippet } from 'svelte';
const getParamValues = (param: string) => {
return new Set(($page.url.searchParams.get(param) || '').split(' ').filter((x) => x !== ''));
return new Set((page.url.searchParams.get(param) || '').split(' ').filter((x) => x !== ''));
};
interface Props {
@@ -28,7 +28,7 @@
$effect(() => {
if (queryParam && $state) {
const searchParams = new URLSearchParams($page.url.searchParams);
const searchParams = new URLSearchParams(page.url.searchParams);
if ($state.size > 0) {
searchParams.set(queryParam, [...$state].join(' '));
} else {