Skip to content

Commit 106b0a8

Browse files
committed
update logic to enable drive deletion
1 parent 12aa805 commit 106b0a8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/contents.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,16 +390,11 @@ export class Drive implements Contents.IDrive {
390390
* @returns A promise which resolves when the file is deleted.
391391
*/
392392
async delete(localPath: string): Promise<void> {
393-
if (localPath !== '') {
394-
const currentDrive = extractCurrentDrive(localPath, this._drivesList);
393+
const currentDrive = extractCurrentDrive(localPath, this._drivesList);
395394

396-
await deleteObjects(currentDrive.name, {
397-
path: formatPath(localPath)
398-
});
399-
} else {
400-
// create new element at root would mean modifying a drive
401-
console.warn('Operation not supported.');
402-
}
395+
await deleteObjects(currentDrive.name, {
396+
path: formatPath(localPath)
397+
});
403398

404399
this._fileChanged.emit({
405400
type: 'delete',

0 commit comments

Comments
 (0)