Merge pull request #74 from manukall/fix_watch_loading_when_no_new_results_are_returned

fix refetch + watchLoading when no new results are returned
This commit is contained in:
Guillaume Chau
2017-06-30 18:01:52 +02:00
committed by GitHub
+5 -1
View File
@@ -268,7 +268,11 @@ export class SmartQuery extends SmartApollo {
refetch (variables) {
variables && (this.options.variables = variables)
if (this.observer) {
const result = this.observer.refetch(variables)
const result = this.observer.refetch(variables).then((result) => {
if (!result.loading) {
this.loadingDone()
}
})
this.maySetLoading()
return result
}