Skip to content

Commit 2be468c

Browse files
committed
dont get from localStorage in shared
1 parent 6c7f350 commit 2be468c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/next/src/next-devtools/dev-overlay/dev-overlay.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import imgApp from './app.png'
77
import { useReducer } from 'react'
88
import { DevOverlay } from './dev-overlay'
99
import {
10+
ACTION_DEVTOOLS_INDICATOR_POSITION,
11+
ACTION_DEVTOOLS_PANEL_CLOSE,
1012
ACTION_DEVTOOLS_PANEL_TOGGLE,
1113
ACTION_ERROR_OVERLAY_CLOSE,
1214
ACTION_ERROR_OVERLAY_OPEN,
@@ -96,6 +98,7 @@ const initialState: OverlayState = {
9698
},
9799
isErrorOverlayOpen: false,
98100
isDevToolsPanelOpen: false,
101+
indicatorPosition: 'bottom-left',
99102
}
100103

101104
function useOverlayReducer() {
@@ -114,6 +117,12 @@ function useOverlayReducer() {
114117
case ACTION_DEVTOOLS_PANEL_TOGGLE: {
115118
return { ...state, isDevToolsPanelOpen: !state.isDevToolsPanelOpen }
116119
}
120+
case ACTION_DEVTOOLS_PANEL_CLOSE: {
121+
return { ...state, isDevToolsPanelOpen: false }
122+
}
123+
case ACTION_DEVTOOLS_INDICATOR_POSITION: {
124+
return { ...state, indicatorPosition: action.indicatorPosition }
125+
}
117126
default: {
118127
return state
119128
}

packages/next/src/next-devtools/dev-overlay/shared.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ export const INITIAL_OVERLAY_STATE: Omit<
207207
versionInfo: { installed: '0.0.0', staleness: 'unknown' },
208208
debugInfo: { devtoolsFrontendUrl: undefined },
209209
isDevToolsPanelOpen: false,
210-
indicatorPosition:
211-
(localStorage.getItem(STORAGE_KEY_POSITION) as Corners) ?? 'bottom-left',
210+
indicatorPosition: 'bottom-left',
212211
}
213212

214213
function getInitialState(

0 commit comments

Comments
 (0)