File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/dataExplorer/components Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 FlexDirection ,
1414 JustifyContent ,
1515} from '@influxdata/clockface'
16+ import { createLocalStorageStateHook } from 'use-local-storage-state'
1617
1718import TimeRangeDropdown from 'src/shared/components/TimeRangeDropdown'
1819import Results from 'src/dataExplorer/components/Results'
@@ -32,6 +33,10 @@ import {DEFAULT_TIME_RANGE} from 'src/shared/constants/timeRanges'
3233const FluxMonacoEditor = lazy ( ( ) =>
3334 import ( 'src/shared/components/FluxMonacoEditor' )
3435)
36+ const useLocalStorageState = createLocalStorageStateHook (
37+ 'dataExplorerQuery' ,
38+ ''
39+ )
3540
3641const INITIAL_HORIZ_RESIZER_HANDLE = 0.2
3742const fakeNotify = notify
@@ -43,7 +48,7 @@ const ResultsPane: FC = () => {
4348 const { basic, query} = useContext ( QueryContext )
4449 const { status, setStatus, setResult, setTime} = useContext ( ResultsContext )
4550
46- const [ text , setText ] = useState ( '' )
51+ const [ text , setText ] = useLocalStorageState ( )
4752 const [ timeRange , setTimeRange ] = useState < TimeRange > ( DEFAULT_TIME_RANGE )
4853
4954 const download = ( ) => {
You can’t perform that action at this time.
0 commit comments