Skip to content

Commit 0fdbc99

Browse files
MikeListerajhillman-ddj
authored andcommitted
Removed browser check
1 parent 963ba4f commit 0fdbc99

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/components/ui/Accordion.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
22
import type { Snippet } from 'svelte';
33
4-
import { browser } from '$app/environment';
54
import { onMount } from 'svelte';
65
import { SvelteSet } from 'svelte/reactivity';
76
@@ -85,11 +84,10 @@
8584
8685
// Only use session storage logic if rememberIsExpandedState is true
8786
onMount(() => {
88-
if (browser && rememberIsExpandedState) {
87+
if (rememberIsExpandedState) {
8988
uniqueSections.forEach((section) => {
9089
// If the section is explicitly expanded, respect that.
9190
// Otherwise, try to restore from session storage.
92-
// **** Is this the behaviour we want? Shouldn't it be the other way around?
9391
if (section.expanded) {
9492
expandedSections.add(section.uniqueid);
9593
} else {
@@ -111,7 +109,7 @@
111109
112110
// Effect to update sessionStorage when uniqueSections change
113111
$effect(() => {
114-
if (browser && rememberIsExpandedState) {
112+
if (rememberIsExpandedState) {
115113
uniqueSections.forEach((section) => {
116114
sessionStorage.setItem(
117115
section.uniqueid,

0 commit comments

Comments
 (0)