fix(frontend): ws replacement
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user