Skip to content

Commit

Permalink
fix: delete
Browse files Browse the repository at this point in the history
  • Loading branch information
cg27shokworks committed Mar 15, 2024
1 parent d53251e commit 60f2ee9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ export class HttpRemoteFileSystem implements RemoteFileSystem {
}

async checkStatusFolder(uuid: Folder['uuid']): Promise<FolderStatuses> {
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;
}

Expand Down

0 comments on commit 60f2ee9

Please sign in to comment.