From 50528955189a388ef2ad6f984e786d24c895c09a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 19 Jan 2018 20:34:01 +0900 Subject: [PATCH] Refactor --- src/api/common/add-file-to-drive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 427b54d72b..23cbc44e61 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); });