fix folder id bug
This commit is contained in:
parent
db8c26cd38
commit
ccc14f3c97
@ -243,7 +243,7 @@ io.on("connection", async (socket) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const onData = pty.onData((data) => {
|
const onData = pty.onData((data) => {
|
||||||
console.log("terminalResponse", id, data)
|
// console.log("terminalResponse", id, data)
|
||||||
io.emit("terminalResponse", {
|
io.emit("terminalResponse", {
|
||||||
id,
|
id,
|
||||||
data,
|
data,
|
||||||
|
@ -48,7 +48,8 @@ const processFiles = async (paths: string[], id: string) => {
|
|||||||
fileData.push({ id: path, data: "" })
|
fileData.push({ id: path, data: "" })
|
||||||
} else {
|
} else {
|
||||||
const folder: TFolder = {
|
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",
|
type: "folder",
|
||||||
name: part,
|
name: part,
|
||||||
children: [],
|
children: [],
|
||||||
@ -67,6 +68,8 @@ const processFiles = async (paths: string[], id: string) => {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
console.log("root", root)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
files: root.children,
|
files: root.children,
|
||||||
fileData,
|
fileData,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user