fix(frontend): ws replacement

This commit is contained in:
h
2026-01-21 02:03:36 +01:00
parent 11811819f1
commit 69ddb3173f
10 changed files with 290 additions and 60 deletions

View File

@@ -3,10 +3,19 @@
import favicon from '$lib/assets/favicon.svg';
import { PUBLIC_CONVEX_URL } from '$env/static/public';
import { setupConvex } from 'convex-svelte';
import { hasWebSocketSupport, setupPollingConvex } from '$lib/convex-polling.svelte';
import { setContext } from 'svelte';
let { children } = $props();
setupConvex(PUBLIC_CONVEX_URL);
const usePolling = !hasWebSocketSupport();
setContext('convex-use-polling', usePolling);
if (usePolling) {
setupPollingConvex(PUBLIC_CONVEX_URL);
} else {
setupConvex(PUBLIC_CONVEX_URL);
}
</script>
<svelte:head><link rel="icon" href={favicon} /></svelte:head>