File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 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';
4242
4343// The initial and max amount of rows fetched by lazy loading
4444const MAX_ROWS_FETCHED = 200 ;
45+ const BROWSER_LAST_LOCATION = 'brower_last_location' ;
4546
4647@subscribeTo ( 'Schema' , 'schema' )
4748@withRouter
@@ -178,6 +179,22 @@ class Browser extends DashboardView {
178179 }
179180 }
180181
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+
181198 componentWillReceiveProps ( nextProps , nextContext ) {
182199 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 ) {
183200 if ( this . props . params . appId !== nextProps . params . appId || ! this . props . params . className ) {
You can’t perform that action at this time.
0 commit comments