From c2befad9967981787227d411b00294d4fab4c965 Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Tue, 1 Oct 2024 17:31:57 -0700 Subject: [PATCH] Moved effect into root effect since its loading deferred --- src/lib/state/client/wharf.svelte.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/state/client/wharf.svelte.ts b/src/lib/state/client/wharf.svelte.ts index d118bb58e..2d109d8b6 100644 --- a/src/lib/state/client/wharf.svelte.ts +++ b/src/lib/state/client/wharf.svelte.ts @@ -72,7 +72,7 @@ export class WharfState { constructor() { if (browser) { - this.chainsSession = JSON.parse(localStorage.getItem('chainSessions') || '{}'); + this.chainsSession = JSON.parse(localStorage.getItem('chainsSession') || '{}'); } } @@ -92,8 +92,10 @@ export class WharfState { transactPlugins } ); - $effect(() => { - localStorage.setItem('chainSessions', JSON.stringify(this.chainsSession)); + $effect.root(() => { + $effect(() => { + localStorage.setItem('chainsSession', JSON.stringify(this.chainsSession)); + }); }); }