Преглед на файлове

Check authentication if there's an upload error

Harry Hedger преди 9 години
родител
ревизия
a857036593
променени са 2 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 7 0
      src/plugins/GoogleDrive.js
  2. 2 0
      src/plugins/Tus10.js

+ 7 - 0
src/plugins/GoogleDrive.js

@@ -173,6 +173,13 @@ export default class Google extends Plugin {
     })
   }
 
+  handleUploadError (response) {
+    this.checkAuthentication()
+      .then((authenticated) => {
+        this.updateState({authenticated})
+      })
+  }
+
   /**
    * Removes session token on client side.
    */

+ 2 - 0
src/plugins/Tus10.js

@@ -119,6 +119,8 @@ export default class Tus10 extends Plugin {
           return resolve('Success')
         }
         this.core.log(`Remote upload of file '${file.name}' failed`)
+        file.acquiredBy.handleUploadError(res)
+
         return reject(new Error('Error: ' + res.statusText))
       })
     })