[🐛] Fixed folder deletion
This commit is contained in:
parent
8e04d6fcc7
commit
cb1fad676f
2 changed files with 6 additions and 2 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -12,8 +12,8 @@
|
|||
"@ptkdev/logger": "^1.8.0",
|
||||
"eruda": "^3.0.1",
|
||||
"filer": "^1.4.1",
|
||||
"prism-code-editor": "^2.2.4",
|
||||
"material-symbols": "^0.14.3",
|
||||
"prism-code-editor": "^2.2.4",
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,11 @@ export default class FilesApp implements App {
|
|||
}
|
||||
}
|
||||
(element.querySelector('.delete') as HTMLElement).onclick = async () => {
|
||||
await window.fs.promises.unlink(dir + separator + file)
|
||||
if (fileStat.isDirectory()) {
|
||||
await window.fs.rmdir(dir + separator + file, () => {})
|
||||
} else {
|
||||
await window.fs.promises.unlink(dir + separator + file)
|
||||
}
|
||||
await setDir(dir)
|
||||
}
|
||||
element.ondblclick = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue