Skip to content

Commit aa116d5

Browse files
committedOct 24, 2024·
fix(kit): support non-localStorage env for timeline storage, closes #635
1 parent 9491178 commit aa116d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

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

+2-2
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 || typeof localStorage === 'undefined') {
6+
if (!isBrowser || typeof localStorage === 'undefined' || localStorage === null) {
77
return
88
}
99
localStorage.setItem(TIMELINE_LAYERS_STATE_STORAGE_ID, JSON.stringify(state))
1010
}
1111

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

0 commit comments

Comments
 (0)
Please sign in to comment.