diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 427b54d72..23cbc44e6 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -266,11 +266,11 @@ export default (user: any, file: string | stream.Readable, ...args) => new Promi } rej(new Error('un-compatible file.')); }) - .then(([path, remove]): Promise => new Promise((res, rej) => { + .then(([path, shouldCleanup]): Promise => new Promise((res, rej) => { addFile(user, path, ...args) .then(file => { res(file); - if (remove) { + if (shouldCleanup) { fs.unlink(path, (e) => { if (e) log(e.stack); });