Skip to content

Commit

Permalink
fix(kit): support non localStorage env for timeline storage, closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Oct 16, 2024
1 parent dbd0eed commit 0573f68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/devtools-kit/src/core/timeline/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { isBrowser } from '@vue/devtools-shared'
const TIMELINE_LAYERS_STATE_STORAGE_ID = '__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__'

export function addTimelineLayersStateToStorage(state: Record<string, boolean | string>) {
if (!isBrowser) {
if (!isBrowser || typeof localStorage === 'undefined') {
return
}
localStorage.setItem(TIMELINE_LAYERS_STATE_STORAGE_ID, JSON.stringify(state))
}

export function getTimelineLayersStateFromStorage() {
if (!isBrowser) {
if (!isBrowser || typeof localStorage === 'undefined') {
return {
recordingState: false,
mouseEventEnabled: false,
Expand Down

0 comments on commit 0573f68

Please sign in to comment.