소스 검색

fix: fix wrong 'no files available' msg flash

Fixes #908
Ifedapo Olarewaju 6 년 전
부모
커밋
40f4e2dc5e
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  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.
   // displays loader view while asynchronous request is being made.
   _loaderWrapper (promise, then, catch_) {
   _loaderWrapper (promise, then, catch_) {
     promise
     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 })
     this.plugin.setPluginState({ loading: true })
   }
   }