Skip to content

Commit

Permalink
- Bandaid fix for duplicating file issue bridge-core#341
Browse files Browse the repository at this point in the history
  • Loading branch information
Xterionix committed Sep 18, 2023
1 parent 0b1df9c commit 58dcdb8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/renderer/src/UI/Sidebar/FileExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class FileExplorer {
if (this.parent) this.parent.sort()

requestIdleCallback(() => this.load()) //Load more files and folders during CPU idle time
} catch (e) {}
} catch (e) { }
}
async load() {
this.children = await Promise.all(
Expand Down Expand Up @@ -184,9 +184,9 @@ export class FileExplorer {
if (this.name === 'cache') return []
return this.is_folder
? this.children
.map(c => c.getAllFiles())
.flat()
.filter(c => c !== undefined)
.map(c => c.getAllFiles())
.flat()
.filter(c => c !== undefined)
: [this.absolute_path]
}

Expand Down Expand Up @@ -222,15 +222,17 @@ export class FileExplorer {
)

await Promise.all([
OmegaCache.duplicate(
this.absolute_path,
newAbsolutePath
).catch(() => {}),
LightningCache.duplicate(this.absolute_path, newAbsolutePath),
// OmegaCache.duplicate(
// this.absolute_path,
// newAbsolutePath
// ).catch(() => { }),
// LightningCache.duplicate(this.absolute_path, newAbsolutePath),
JSONFileMasks.duplicate(this.absolute_path, newAbsolutePath),
fs.copyFile(this.absolute_path, newAbsolutePath),
])

console.log(this.absolute_path, newAbsolutePath)

this.parent.children.push(
new FileExplorer(
this.parent,
Expand Down

0 comments on commit 58dcdb8

Please sign in to comment.