Skip to content

Commit b52daa7

Browse files
committed
Fixes for recursive folder and deployment issues
1 parent f882ae9 commit b52daa7

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "concore-editor",
33
"version": "0.1.0",
44
"private": true,
5-
"homepage": "https://controlcore-project.github.io/concore-editor/",
5+
"homepage": "https://aviralkumargoel.com/concore-editor",
66
"dependencies": {
77
"@szhsin/react-menu": "^1.10.0",
88
"@testing-library/jest-dom": "^5.11.4",

src/component/fileBrowser.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,22 @@ const LocalFileBrowser = ({ superState, dispatcher }) => {
5050
};
5151

5252
const handleFileInDirs = async (topKey, value) => {
53+
let topLevel = topKey;
5354
let state = [];
5455
// eslint-disable-next-line no-restricted-syntax
5556
for await (const [key, valueSubDir] of value.entries()) {
5657
if (valueSubDir.kind === 'file') {
5758
const fileData = await valueSubDir.getFile();
5859
state = state.concat([{
59-
key: `${topKey}/${value.name}/${key}`,
60+
key: `${topLevel}/${value.name}/${key}`,
6061
modified: fileData.lastModified,
6162
size: fileData.size,
6263
fileObj: fileData,
6364
fileHandle: value,
6465
}]);
6566
} else if (valueSubDir.kind === 'directory') {
66-
const res = await handleFileInDirs();
67+
topLevel = `${topKey}/${value.name}`;
68+
const res = await handleFileInDirs(topLevel, valueSubDir);
6769
state = state.concat(res);
6870
}
6971
}

0 commit comments

Comments
 (0)