summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/lib
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-11-04 15:29:50 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-11-07 10:46:07 +0100
commitb73485ab73c6868d799f886196a4ad11a03d2cec (patch)
tree9c9502c1c04b400ef7bf91363998b3e7b98895d8 /gui/src/renderer/lib
parent40bc4e6bbd51fd78ff67e376a5fbe921cd4c4964 (diff)
downloadmullvadvpn-b73485ab73c6868d799f886196a4ad11a03d2cec.tar.xz
mullvadvpn-b73485ab73c6868d799f886196a4ad11a03d2cec.zip
Save expanded state for sections in location state and restore on navigation
Diffstat (limited to 'gui/src/renderer/lib')
-rw-r--r--gui/src/renderer/lib/history.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/gui/src/renderer/lib/history.tsx b/gui/src/renderer/lib/history.tsx
index e74552f786..b81aef50fe 100644
--- a/gui/src/renderer/lib/history.tsx
+++ b/gui/src/renderer/lib/history.tsx
@@ -194,7 +194,7 @@ export default class History {
pathname: location.pathname ?? this.location.pathname,
search: location.search ?? '',
hash: location.hash ?? '',
- state: location.state ?? { scrollPosition: [0, 0], expandedSections: [] },
+ state: location.state ?? { scrollPosition: [0, 0], expandedSections: {} },
key: location.key ?? this.getRandomKey(),
};
}
@@ -205,7 +205,7 @@ export default class History {
pathname: path,
search: '',
hash: '',
- state: state ?? { scrollPosition: [0, 0], expandedSections: [] },
+ state: state ?? { scrollPosition: [0, 0], expandedSections: {} },
key: this.getRandomKey(),
};
}