Explorar el Código

tus: Remove this.getFile() in favour of this.uppy.getFile()

Renée Kooi hace 7 años
padre
commit
263763cb02
Se han modificado 1 ficheros con 2 adiciones y 6 borrados
  1. 2 6
      src/plugins/Tus.js

+ 2 - 6
src/plugins/Tus.js

@@ -260,7 +260,7 @@ module.exports = class Tus extends Plugin {
 
 
         return res.json().then((data) => {
         return res.json().then((data) => {
           this.uppy.setFileState(file.id, { serverToken: data.token })
           this.uppy.setFileState(file.id, { serverToken: data.token })
-          file = this.getFile(file.id)
+          file = this.uppy.getFile(file.id)
           return file
           return file
         })
         })
       })
       })
@@ -346,10 +346,6 @@ module.exports = class Tus extends Plugin {
     })
     })
   }
   }
 
 
-  getFile (fileID) {
-    return this.uppy.state.files[fileID]
-  }
-
   updateFile (file) {
   updateFile (file) {
     const files = Object.assign({}, this.uppy.state.files, {
     const files = Object.assign({}, this.uppy.state.files, {
       [file.id]: file
       [file.id]: file
@@ -358,7 +354,7 @@ module.exports = class Tus extends Plugin {
   }
   }
 
 
   onReceiveUploadUrl (file, uploadURL) {
   onReceiveUploadUrl (file, uploadURL) {
-    const currentFile = this.getFile(file.id)
+    const currentFile = this.uppy.getFile(file.id)
     if (!currentFile) return
     if (!currentFile) return
     // Only do the update if we didn't have an upload URL yet,
     // Only do the update if we didn't have an upload URL yet,
     // or resume: false in options
     // or resume: false in options