Browse Source

Merge pull request #938 from transloadit/wrong-no-files-msg

fix: fix wrong 'no files available' msg flash
Artur Paikin 6 years ago
parent
commit
646b10edcb
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/@uppy/provider-views/src/index.js

+ 7 - 2
packages/@uppy/provider-views/src/index.js

@@ -523,8 +523,13 @@ module.exports = class ProviderView {
   // displays loader view while asynchronous request is being made.
   _loaderWrapper (promise, then, catch_) {
     promise
-      .then(then).catch(catch_)
-      .then(() => this.plugin.setPluginState({ loading: false })) // always called.
+      .then((result) => {
+        this.plugin.setPluginState({ loading: false })
+        then(result)
+      }).catch((err) => {
+        this.plugin.setPluginState({ loading: false })
+        catch_(err)
+      })
     this.plugin.setPluginState({ loading: true })
   }