@@ -18,6 +18,7 @@ import { logoutUser } from '../modules/User/actions';
1818import getConfig from '../utils/getConfig' ;
1919import { metaKeyName , metaKey } from '../utils/metaKey' ;
2020import { getIsUserOwner } from '../modules/IDE/selectors/users' ;
21+ import { selectSketchPath } from '../modules/IDE/selectors/project' ;
2122
2223import CaretLeftIcon from '../images/left-arrow.svg' ;
2324import TriangleIcon from '../images/down-filled-triangle.svg' ;
@@ -245,7 +246,7 @@ class Nav extends React.PureComponent {
245246 />
246247 </ li >
247248 < li className = "nav__item nav__item--no-icon" >
248- < Link to = "/" className = "nav__back-link" >
249+ < Link to = { this . props . editorLink } className = "nav__back-link" >
249250 < CaretLeftIcon
250251 className = "nav__back-icon"
251252 focusable = "false"
@@ -990,7 +991,8 @@ Nav.propTypes = {
990991 t : PropTypes . func . isRequired ,
991992 setLanguage : PropTypes . func . isRequired ,
992993 language : PropTypes . string . isRequired ,
993- isUserOwner : PropTypes . bool . isRequired
994+ isUserOwner : PropTypes . bool . isRequired ,
995+ editorLink : PropTypes . string
994996} ;
995997
996998Nav . defaultProps = {
@@ -1003,7 +1005,8 @@ Nav.defaultProps = {
10031005 warnIfUnsavedChanges : undefined ,
10041006 params : {
10051007 username : undefined
1006- }
1008+ } ,
1009+ editorLink : '/'
10071010} ;
10081011
10091012function mapStateToProps ( state ) {
@@ -1013,7 +1016,8 @@ function mapStateToProps(state) {
10131016 unsavedChanges : state . ide . unsavedChanges ,
10141017 rootFile : state . files . filter ( ( file ) => file . name === 'root' ) [ 0 ] ,
10151018 language : state . preferences . language ,
1016- isUserOwner : getIsUserOwner ( state )
1019+ isUserOwner : getIsUserOwner ( state ) ,
1020+ editorLink : selectSketchPath ( state )
10171021 } ;
10181022}
10191023
0 commit comments