From 10cf56e94aac7c75b74a50fc975443c0c5237677 Mon Sep 17 00:00:00 2001 From: sage Date: Sun, 1 Aug 2021 20:15:56 +0700 Subject: [PATCH] :ambulance: (svelte) Use onMount for determining session --- packages/svelte/lib/Giscus.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/svelte/lib/Giscus.svelte b/packages/svelte/lib/Giscus.svelte index 4f9db751..0ca68506 100644 --- a/packages/svelte/lib/Giscus.svelte +++ b/packages/svelte/lib/Giscus.svelte @@ -36,7 +36,7 @@ session }) - $: { + onMount(() => { const origin = location.href const url = new URL(origin) const savedSession = localStorage.getItem(GISCUS_SESSION_KEY) @@ -55,7 +55,7 @@ console.warn(`${formatError(e?.message)} Session has been cleared.`) } } - } + }) onMount(addDefaultStyles)