Skip to content

Commit

Permalink
Moved effect into root effect since its loading deferred
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Oct 2, 2024
1 parent 95d6acf commit c2befad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/state/client/wharf.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class WharfState {

constructor() {
if (browser) {
this.chainsSession = JSON.parse(localStorage.getItem('chainSessions') || '{}');
this.chainsSession = JSON.parse(localStorage.getItem('chainsSession') || '{}');
}
}

Expand All @@ -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));
});
});
}

Expand Down

0 comments on commit c2befad

Please sign in to comment.