@@ -21,6 +21,7 @@ import AggregationPanel from '../../../components/AggregationPanel/AggregationPa
21
21
22
22
const BROWSER_SHOW_ROW_NUMBER = 'browserShowRowNumber' ;
23
23
const AGGREGATION_PANEL_VISIBLE = 'aggregationPanelVisible' ;
24
+ const BROWSER_SCROLL_TO_TOP = 'browserScrollToTop' ;
24
25
25
26
function formatValueForCopy ( value , type ) {
26
27
if ( value === undefined ) {
@@ -83,6 +84,8 @@ export default class DataBrowser extends React.Component {
83
84
window . localStorage ?. getItem ( BROWSER_SHOW_ROW_NUMBER ) === 'true' ;
84
85
const storedPanelVisible =
85
86
window . localStorage ?. getItem ( AGGREGATION_PANEL_VISIBLE ) === 'true' ;
87
+ const storedScrollToTop =
88
+ window . localStorage ?. getItem ( BROWSER_SCROLL_TO_TOP ) !== 'false' ;
86
89
const hasAggregation =
87
90
props . classwiseCloudFunctions ?. [
88
91
`${ props . app . applicationId } ${ props . appName } `
@@ -107,7 +110,7 @@ export default class DataBrowser extends React.Component {
107
110
showAggregatedData : true ,
108
111
frozenColumnIndex : - 1 ,
109
112
showRowNumber : storedRowNumber ,
110
- scrollToTop : true ,
113
+ scrollToTop : storedScrollToTop ,
111
114
prefetchCache : { } ,
112
115
selectionHistory : [ ] ,
113
116
} ;
@@ -669,7 +672,11 @@ export default class DataBrowser extends React.Component {
669
672
}
670
673
671
674
toggleScrollToTop ( ) {
672
- this . setState ( prevState => ( { scrollToTop : ! prevState . scrollToTop } ) ) ;
675
+ this . setState ( prevState => {
676
+ const newScrollToTop = ! prevState . scrollToTop ;
677
+ window . localStorage ?. setItem ( BROWSER_SCROLL_TO_TOP , newScrollToTop ) ;
678
+ return { scrollToTop : newScrollToTop } ;
679
+ } ) ;
673
680
}
674
681
675
682
getPrefetchSettings ( ) {
0 commit comments