fix folder id bug

This commit is contained in:
Ishaan Dey 2024-05-09 00:45:10 -07:00
parent db8c26cd38
commit ccc14f3c97
2 changed files with 5 additions and 2 deletions

View File

@ -243,7 +243,7 @@ io.on("connection", async (socket) => {
})
const onData = pty.onData((data) => {
console.log("terminalResponse", id, data)
// console.log("terminalResponse", id, data)
io.emit("terminalResponse", {
id,
data,

View File

@ -48,7 +48,8 @@ const processFiles = async (paths: string[], id: string) => {
fileData.push({ id: path, data: "" })
} else {
const folder: TFolder = {
id: path, // todo: wrong id. for example, folder "src" ID is: projects/a7vgttfqbgy403ratp7du3ln/src/App.css
// id: path, // todo: wrong id. for example, folder "src" ID is: projects/a7vgttfqbgy403ratp7du3ln/src/App.css
id: `projects/${id}/${parts.slice(0, i + 1).join("/")}`,
type: "folder",
name: part,
children: [],
@ -67,6 +68,8 @@ const processFiles = async (paths: string[], id: string) => {
})
)
console.log("root", root)
return {
files: root.children,
fileData,