Skip to content

Commit 0573f68

Browse files
committed
fix(kit): support non localStorage env for timeline storage, closes #635
1 parent dbd0eed commit 0573f68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/devtools-kit/src/core/timeline/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { isBrowser } from '@vue/devtools-shared'
33
const TIMELINE_LAYERS_STATE_STORAGE_ID = '__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__'
44

55
export function addTimelineLayersStateToStorage(state: Record<string, boolean | string>) {
6-
if (!isBrowser) {
6+
if (!isBrowser || typeof localStorage === 'undefined') {
77
return
88
}
99
localStorage.setItem(TIMELINE_LAYERS_STATE_STORAGE_ID, JSON.stringify(state))
1010
}
1111

1212
export function getTimelineLayersStateFromStorage() {
13-
if (!isBrowser) {
13+
if (!isBrowser || typeof localStorage === 'undefined') {
1414
return {
1515
recordingState: false,
1616
mouseEventEnabled: false,

0 commit comments

Comments
 (0)