@@ -171,7 +171,7 @@ export const useZoomRequeryXDomainSettings = (args: ZoomRequeryArgs) => {
171171 } , [ storedDomain , data ] ) // eslint-disable-line react-hooks/exhaustive-deps
172172
173173 const [ domain , setDomain ] = useState ( initialDomain )
174- const [ preZoomDomain , setPreZoomDomain ] = useState < Array < number > > ( null )
174+ const [ preZoomDomain ] = useOneWayState ( initialDomain )
175175
176176 const getAllVariablesWithTimeDomain = ( state : AppState ) =>
177177 getAllVariablesForZoomRequery ( state , timeRange ? domain : [ ] )
@@ -218,7 +218,6 @@ export const useZoomRequeryXDomainSettings = (args: ZoomRequeryArgs) => {
218218
219219 const setZoomDomain = ( updatedDomain : number [ ] ) => {
220220 if ( ! preZoomResult ) {
221- setPreZoomDomain ( initialDomain )
222221 setPreZoomResult ( parsedResult )
223222 }
224223 setDomain ( updatedDomain )
@@ -263,7 +262,7 @@ export const useZoomRequeryYDomainSettings = (args: ZoomRequeryArgs) => {
263262 } , [ storedDomain , data ] ) // eslint-disable-line react-hooks/exhaustive-deps
264263
265264 const [ domain , setDomain ] = useState ( initialDomain )
266- const [ preZoomDomain , setPreZoomDomain ] = useState < Array < number > > ( null )
265+ const [ preZoomDomain ] = useOneWayState ( initialDomain )
267266
268267 const getAllVariablesWithTimeDomain = ( state : AppState ) =>
269268 getAllVariablesForZoomRequery ( state , timeRange ? domain : [ ] )
@@ -310,7 +309,6 @@ export const useZoomRequeryYDomainSettings = (args: ZoomRequeryArgs) => {
310309
311310 const setZoomDomain = ( updatedDomain : number [ ] ) => {
312311 if ( ! preZoomResult ) {
313- setPreZoomDomain ( initialDomain )
314312 setPreZoomResult ( parsedResult )
315313 }
316314 setDomain ( updatedDomain )
0 commit comments