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

fix: fix wrong 'no files available' msg flash
This commit is contained in:
Artur Paikin 2018-07-10 20:14:47 -04:00 committed by GitHub
commit 646b10edcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 })
}