File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { withRouter } from 'lib/withRouter';
1414import subscribeTo from 'lib/subscribeTo' ;
1515import { ActionTypes as SchemaActionTypes } from 'lib/stores/SchemaStore' ;
1616
17+ const BROWSER_LAST_LOCATION = 'brower_last_location' ;
18+
1719export default
1820@subscribeTo ( 'Schema' , 'schema' )
1921@withRouter
@@ -252,12 +254,29 @@ class Views extends TableView {
252254 const filters = JSON . stringify ( [
253255 { field, constraint : 'eq' , compareTo : id } ,
254256 ] ) ;
255- this . props . navigate (
256- generatePath (
257- this . context ,
258- `browser/${ className } ?filters=${ encodeURIComponent ( filters ) } `
259- )
257+ const path = generatePath (
258+ this . context ,
259+ `browser/${ className } ?filters=${ encodeURIComponent ( filters ) } `
260260 ) ;
261+ try {
262+ const existing = JSON . parse (
263+ window . localStorage . getItem ( BROWSER_LAST_LOCATION )
264+ ) || [ ] ;
265+ const updated = existing . filter (
266+ e => e . appId !== this . context . applicationId
267+ ) ;
268+ updated . push ( {
269+ appId : this . context . applicationId ,
270+ location : path ,
271+ } ) ;
272+ window . localStorage . setItem (
273+ BROWSER_LAST_LOCATION ,
274+ JSON . stringify ( updated )
275+ ) ;
276+ } catch {
277+ // ignore write errors
278+ }
279+ this . props . navigate ( path ) ;
261280 }
262281
263282 showNote ( message , isError ) {
You can’t perform that action at this time.
0 commit comments