Skip to content

Commit b44d62b

Browse files
committed
add file selector
1 parent d82261a commit b44d62b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/modules/IDE/components/IDEKeyHandlers.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export const useIDEKeyHandlers = ({ getContent }) => {
2626
const sidebarIsExpanded = useSelector((state) => state.ide.sidebarIsExpanded);
2727
const consoleIsExpanded = useSelector((state) => state.ide.consoleIsExpanded);
2828

29+
const rootFile = useSelector(
30+
(state) => state.files.filter((file) => file.name === 'root')[0]
31+
);
32+
2933
const isUserOwner = useSelector(getIsUserOwner);
3034
const isAuthenticated = useSelector(getAuthenticated);
3135
const sketchOwner = useSelector(getSketchOwner);
@@ -76,7 +80,7 @@ export const useIDEKeyHandlers = ({ getContent }) => {
7680
'ctrl-alt-n': (e) => {
7781
e.preventDefault();
7882
e.stopPropagation();
79-
dispatch(newFile());
83+
dispatch(newFile(rootFile.id));
8084
},
8185
'ctrl-`': (e) => {
8286
e.preventDefault();

0 commit comments

Comments
 (0)