File tree 1 file changed +17
-0
lines changed
src/dashboard/Data/Browser
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import { withRouter } from 'lib/withRouter';
42
42
43
43
// The initial and max amount of rows fetched by lazy loading
44
44
const MAX_ROWS_FETCHED = 200 ;
45
+ const BROWSER_LAST_LOCATION = 'brower_last_location' ;
45
46
46
47
@subscribeTo ( 'Schema' , 'schema' )
47
48
@withRouter
@@ -178,6 +179,22 @@ class Browser extends DashboardView {
178
179
}
179
180
}
180
181
182
+ componentDidMount ( ) {
183
+ if ( window . localStorage ) {
184
+ const pathname = window . localStorage . getItem ( BROWSER_LAST_LOCATION ) ;
185
+ window . localStorage . removeItem ( BROWSER_LAST_LOCATION )
186
+ if ( pathname ) {
187
+ setTimeout ( function ( ) { this . props . navigate ( pathname ) } . bind ( this ) )
188
+ }
189
+ }
190
+ }
191
+
192
+ componentWillUnmount ( ) {
193
+ if ( window . localStorage ) {
194
+ window . localStorage . setItem ( BROWSER_LAST_LOCATION , this . props . location . pathname + this . props . location . search ) ;
195
+ }
196
+ }
197
+
181
198
componentWillReceiveProps ( nextProps , nextContext ) {
182
199
if ( this . props . params . appId !== nextProps . params . appId || this . props . params . className !== nextProps . params . className || this . props . location . search !== nextProps . location . search || this . props . params ?. relationName !== nextProps . params ?. relationName ) {
183
200
if ( this . props . params . appId !== nextProps . params . appId || ! this . props . params . className ) {
You can’t perform that action at this time.
0 commit comments