Skip to content

Commit

Permalink
Use selectRootFile in Nav.
Browse files Browse the repository at this point in the history
  • Loading branch information
lindapaiste committed Aug 11, 2023
1 parent c58ff78 commit e63cb03
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions client/modules/IDE/components/Header/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { setLanguage } from '../../actions/preferences';
import NavBar from '../../../../components/Nav/NavBar';
import CaretLeftIcon from '../../../../images/left-arrow.svg';
import LogoIcon from '../../../../images/p5js-logo-small.svg';
import { selectRootFile } from '../../selectors/files';
import { selectSketchPath } from '../../selectors/project';
import { metaKey, metaKeyName } from '../../../../utils/metaKey';
import { useSketchActions } from '../../hooks';
Expand Down Expand Up @@ -102,17 +103,14 @@ const DashboardMenu = () => {
);
};

const ProjectMenu = (props) => {
const ProjectMenu = () => {
const isUserOwner = useSelector(getIsUserOwner);
const project = useSelector((state) => state.project);
const user = useSelector((state) => state.user);

const isUnsaved = !project?.id;

// TODO: use selectRootFile selector
const rootFile = useSelector(
(state) => state.files.filter((file) => file.name === 'root')[0]
);
const rootFile = useSelector(selectRootFile);

const cmRef = useContext(CmControllerContext);

Expand Down

0 comments on commit e63cb03

Please sign in to comment.