Skip to content

Commit 26e3cfa

Browse files
committed
dont get from localStorage in shared
1 parent bb77d0c commit 26e3cfa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import imgApp from './app.png'
77
import { useReducer } from 'react'
88
import { DevOverlay } from './dev-overlay'
99
import {
10+
ACTION_DEVTOOLS_INDICATOR_POSITION,
1011
ACTION_DEVTOOLS_PANEL_CLOSE,
1112
ACTION_DEVTOOLS_PANEL_TOGGLE,
1213
ACTION_ERROR_OVERLAY_CLOSE,
@@ -97,6 +98,7 @@ const initialState: OverlayState = {
9798
},
9899
isErrorOverlayOpen: false,
99100
isDevToolsPanelOpen: false,
101+
indicatorPosition: 'bottom-left',
100102
}
101103

102104
function useOverlayReducer() {
@@ -118,6 +120,9 @@ function useOverlayReducer() {
118120
case ACTION_DEVTOOLS_PANEL_CLOSE: {
119121
return { ...state, isDevToolsPanelOpen: false }
120122
}
123+
case ACTION_DEVTOOLS_INDICATOR_POSITION: {
124+
return { ...state, indicatorPosition: action.indicatorPosition }
125+
}
121126
default: {
122127
return state
123128
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ export const INITIAL_OVERLAY_STATE: Omit<
211211
versionInfo: { installed: '0.0.0', staleness: 'unknown' },
212212
debugInfo: { devtoolsFrontendUrl: undefined },
213213
isDevToolsPanelOpen: false,
214-
indicatorPosition:
215-
(localStorage.getItem(STORAGE_KEY_POSITION) as Corners) ?? 'bottom-left',
214+
indicatorPosition: 'bottom-left',
216215
}
217216

218217
function getInitialState(

0 commit comments

Comments
 (0)