File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import type { Snippet } from ' svelte' ;
3
3
4
- import { browser } from ' $app/environment' ;
5
4
import { onMount } from ' svelte' ;
6
5
import { SvelteSet } from ' svelte/reactivity' ;
7
6
85
84
86
85
// Only use session storage logic if rememberIsExpandedState is true
87
86
onMount (() => {
88
- if (browser && rememberIsExpandedState ) {
87
+ if (rememberIsExpandedState ) {
89
88
uniqueSections .forEach ((section ) => {
90
89
// If the section is explicitly expanded, respect that.
91
90
// Otherwise, try to restore from session storage.
92
- // **** Is this the behaviour we want? Shouldn't it be the other way around?
93
91
if (section .expanded ) {
94
92
expandedSections .add (section .uniqueid );
95
93
} else {
111
109
112
110
// Effect to update sessionStorage when uniqueSections change
113
111
$effect (() => {
114
- if (browser && rememberIsExpandedState ) {
112
+ if (rememberIsExpandedState ) {
115
113
uniqueSections .forEach ((section ) => {
116
114
sessionStorage .setItem (
117
115
section .uniqueid ,
You can’t perform that action at this time.
0 commit comments