diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-01-19 20:34:01 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-19 20:34:01 +0900 |
| commit | 50528955189a388ef2ad6f984e786d24c895c09a (patch) | |
| tree | e4a217c5363b10faa2be1d4d6eb871ddc82ea20f /src | |
| parent | Update api.ts (diff) | |
| download | sharkey-50528955189a388ef2ad6f984e786d24c895c09a.tar.gz sharkey-50528955189a388ef2ad6f984e786d24c895c09a.tar.bz2 sharkey-50528955189a388ef2ad6f984e786d24c895c09a.zip | |
Refactor
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/common/add-file-to-drive.ts | 4 |
1 files 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<any> => new Promise((res, rej) => { + .then(([path, shouldCleanup]): Promise<any> => 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); }); |