diff --git a/src/apps/sync-engine/callbacks-controllers/controllers/DeleteController.ts b/src/apps/sync-engine/callbacks-controllers/controllers/DeleteController.ts index 9881e5c73..defc439df 100644 --- a/src/apps/sync-engine/callbacks-controllers/controllers/DeleteController.ts +++ b/src/apps/sync-engine/callbacks-controllers/controllers/DeleteController.ts @@ -89,9 +89,8 @@ export class DeleteController extends CallbackController { } private CleanQueueFolder(folderUuid: Folder['uuid']) { - const folders = this.foldersQueue.values; - const toReversed = folders.reverse(); - toReversed.forEach((folder) => { + const reversedFolders = this.foldersQueue.reversedValues; + reversedFolders.forEach((folder) => { const isParentFolder = this.folderContainerDetector.run( folder, folderUuid diff --git a/src/context/virtual-drive/shared/domain/DelayQueue.ts b/src/context/virtual-drive/shared/domain/DelayQueue.ts index 19b31f561..63f17a6e8 100644 --- a/src/context/virtual-drive/shared/domain/DelayQueue.ts +++ b/src/context/virtual-drive/shared/domain/DelayQueue.ts @@ -68,6 +68,10 @@ export class DelayQueue { return Array.from(this.queue.keys()); } + get reversedValues(): string[] { + return Array.from(this.queue.keys()).reverse(); + } + get isEmpty(): boolean { return this.queue.size === 0; }