@@ -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"
@@ -980,7 +981,8 @@ Nav.propTypes = {
980981 t : PropTypes . func . isRequired ,
981982 setLanguage : PropTypes . func . isRequired ,
982983 language : PropTypes . string . isRequired ,
983- isUserOwner : PropTypes . bool . isRequired
984+ isUserOwner : PropTypes . bool . isRequired ,
985+ editorLink : PropTypes . string
984986} ;
985987
986988Nav . defaultProps = {
@@ -993,7 +995,8 @@ Nav.defaultProps = {
993995 warnIfUnsavedChanges : undefined ,
994996 params : {
995997 username : undefined
996- }
998+ } ,
999+ editorLink : '/'
9971000} ;
9981001
9991002function mapStateToProps ( state ) {
@@ -1003,7 +1006,8 @@ function mapStateToProps(state) {
10031006 unsavedChanges : state . ide . unsavedChanges ,
10041007 rootFile : state . files . filter ( ( file ) => file . name === 'root' ) [ 0 ] ,
10051008 language : state . preferences . language ,
1006- isUserOwner : getIsUserOwner ( state )
1009+ isUserOwner : getIsUserOwner ( state ) ,
1010+ editorLink : selectSketchPath ( state )
10071011 } ;
10081012}
10091013
0 commit comments