diff --git a/src/context/virtual-drive/folders/application/FolderPlaceholderDeleter.ts b/src/context/virtual-drive/folders/application/FolderPlaceholderDeleter.ts index 0a854850b..c8cc83feb 100644 --- a/src/context/virtual-drive/folders/application/FolderPlaceholderDeleter.ts +++ b/src/context/virtual-drive/folders/application/FolderPlaceholderDeleter.ts @@ -6,6 +6,8 @@ import { RemoteFileSystem } from '../domain/file-systems/RemoteFileSystem'; import { LocalFileSystem } from '../domain/file-systems/LocalFileSystem'; import Logger from 'electron-log'; import { sleep } from '../../../../apps/main/util'; +import fs from 'fs/promises'; + export class FolderPlaceholderDeleter { constructor( private readonly relativePathToAbsoluteConverter: RelativePathToAbsoluteConverter, @@ -56,6 +58,8 @@ export class FolderPlaceholderDeleter { const win32AbsolutePath = this.relativePathToAbsoluteConverter.run( remote.path ); + Logger.info(`win32AbsolutePath in delete: ${win32AbsolutePath}`); + //await fs.rm(win32AbsolutePath, { recursive: true, force: true }); await this.local.deleteFileSyncRoot(remote.path); } } diff --git a/src/context/virtual-drive/folders/infrastructure/HttpRemoteFileSystem.ts b/src/context/virtual-drive/folders/infrastructure/HttpRemoteFileSystem.ts index f3b7d98c1..c5ddd37e8 100644 --- a/src/context/virtual-drive/folders/infrastructure/HttpRemoteFileSystem.ts +++ b/src/context/virtual-drive/folders/infrastructure/HttpRemoteFileSystem.ts @@ -61,11 +61,12 @@ export class HttpRemoteFileSystem implements RemoteFileSystem { } async checkStatusFolder(uuid: Folder['uuid']): Promise { - const response = await this.driveClient.get( - `${process.env.NEW_DRIVE_URL}/drive/folders/${uuid}/meta` - ); - - if (response.status === 404) { + let response; + try { + response = await this.trashClient.get( + `${process.env.NEW_DRIVE_URL}/drive/folders/${uuid}/meta` + ); + } catch { return FolderStatuses.DELETED; }