Skip to content

Commit 20404ff

Browse files
committed
Bug fix
1 parent cade618 commit 20404ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/state/features/structure/utils/getFileTree.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ const updateFileContents = (id: string, content: string) => {
4545
};
4646

4747
const getSelectedFile = () => {
48-
return store.getState().structure.selected;
48+
const selectedTab = store.getState().tabs.selected;
49+
if (selectedTab === "") {
50+
return store.getState().structure.selected;
51+
}
52+
return selectedTab;
4953
};
5054

5155
export { getFileTree, updateFileContents, getSelectedFile };

0 commit comments

Comments
 (0)