ソースを参照

@uppy/aws-s3-multipart: fix linter issues (#3188)

Antoine du Hamel 3 年 前
コミット
017c21a92c
1 ファイル変更5 行追加6 行削除
  1. 5 6
      packages/@uppy/aws-s3-multipart/src/MultipartUploader.js

+ 5 - 6
packages/@uppy/aws-s3-multipart/src/MultipartUploader.js

@@ -327,6 +327,7 @@ class MultipartUploader {
     xhr.responseType = 'text'
     xhr.responseType = 'text'
 
 
     function cleanup () {
     function cleanup () {
+      // eslint-disable-next-line no-use-before-define
       signal.removeEventListener('abort', onabort)
       signal.removeEventListener('abort', onabort)
     }
     }
     function onabort () {
     function onabort () {
@@ -357,6 +358,7 @@ class MultipartUploader {
         defer.reject(error)
         defer.reject(error)
         return
         return
       }
       }
+
       // This avoids the net::ERR_OUT_OF_MEMORY in Chromium Browsers.
       // This avoids the net::ERR_OUT_OF_MEMORY in Chromium Browsers.
       this.chunks[index] = null
       this.chunks[index] = null
 
 
@@ -442,12 +444,9 @@ class MultipartUploader {
     this.isPaused = true
     this.isPaused = true
   }
   }
 
 
-  abort (opts = {}) {
-    const really = opts.really || false
-
-    if (!really) return this.pause()
-
-    this.#abortUpload()
+  abort (opts = undefined) {
+    if (opts?.really) this.#abortUpload()
+    else this.pause()
   }
   }
 }
 }