Skip to content

Commit

Permalink
add file selector
Browse files Browse the repository at this point in the history
  • Loading branch information
raclim committed Aug 2, 2024
1 parent d82261a commit b44d62b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/modules/IDE/components/IDEKeyHandlers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const useIDEKeyHandlers = ({ getContent }) => {
const sidebarIsExpanded = useSelector((state) => state.ide.sidebarIsExpanded);
const consoleIsExpanded = useSelector((state) => state.ide.consoleIsExpanded);

const rootFile = useSelector(
(state) => state.files.filter((file) => file.name === 'root')[0]
);

const isUserOwner = useSelector(getIsUserOwner);
const isAuthenticated = useSelector(getAuthenticated);
const sketchOwner = useSelector(getSketchOwner);
Expand Down Expand Up @@ -76,7 +80,7 @@ export const useIDEKeyHandlers = ({ getContent }) => {
'ctrl-alt-n': (e) => {
e.preventDefault();
e.stopPropagation();
dispatch(newFile());
dispatch(newFile(rootFile.id));
},
'ctrl-`': (e) => {
e.preventDefault();
Expand Down

0 comments on commit b44d62b

Please sign in to comment.