File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ export default function CamerasListPage() {
36
36
const [ processedCameras , setProcessedCameras ] = useState ( null ) ;
37
37
38
38
// UseEffect hooks and data functions
39
+ useEffect ( ( ) => {
40
+ const scrollPosition = sessionStorage . getItem ( 'scrollPosition' ) ;
41
+ if ( scrollPosition ) {
42
+ window . scrollTo ( 0 , parseInt ( scrollPosition , 10 ) ) ;
43
+ }
44
+ } ) ;
45
+
39
46
const getCamerasData = async ( ) => {
40
47
isInitialMount . current = false ;
41
48
@@ -75,11 +82,6 @@ export default function CamerasListPage() {
75
82
if ( selectedRoute && selectedRoute . routeFound ) {
76
83
setRouteEdit ( false ) ;
77
84
}
78
-
79
- // const scrollPosition = sessionStorage.getItem('scrollPosition');
80
- // if (scrollPosition) {
81
- // window.scrollTo(0, parseInt(scrollPosition, 10));
82
- // }
83
85
} , [ selectedRoute ] ) ;
84
86
85
87
return (
You can’t perform that action at this time.
0 commit comments