File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { setLanguage } from '../../actions/preferences';
14
14
import NavBar from '../../../../components/Nav/NavBar' ;
15
15
import CaretLeftIcon from '../../../../images/left-arrow.svg' ;
16
16
import LogoIcon from '../../../../images/p5js-logo-small.svg' ;
17
+ import { selectRootFile } from '../../selectors/files' ;
17
18
import { selectSketchPath } from '../../selectors/project' ;
18
19
import { metaKey , metaKeyName } from '../../../../utils/metaKey' ;
19
20
import { useSketchActions } from '../../hooks' ;
@@ -102,17 +103,14 @@ const DashboardMenu = () => {
102
103
) ;
103
104
} ;
104
105
105
- const ProjectMenu = ( props ) => {
106
+ const ProjectMenu = ( ) => {
106
107
const isUserOwner = useSelector ( getIsUserOwner ) ;
107
108
const project = useSelector ( ( state ) => state . project ) ;
108
109
const user = useSelector ( ( state ) => state . user ) ;
109
110
110
111
const isUnsaved = ! project ?. id ;
111
112
112
- // TODO: use selectRootFile selector
113
- const rootFile = useSelector (
114
- ( state ) => state . files . filter ( ( file ) => file . name === 'root' ) [ 0 ]
115
- ) ;
113
+ const rootFile = useSelector ( selectRootFile ) ;
116
114
117
115
const cmRef = useContext ( CmControllerContext ) ;
118
116
You can’t perform that action at this time.
0 commit comments