Skip to content

Commit 6a28b75

Browse files
author
Guillaume Chau
authored
Merge pull request #74 from manukall/fix_watch_loading_when_no_new_results_are_returned
fix refetch + watchLoading when no new results are returned
2 parents b7e4e13 + 709fcd9 commit 6a28b75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/smart-apollo.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ export class SmartQuery extends SmartApollo {
268268
refetch (variables) {
269269
variables && (this.options.variables = variables)
270270
if (this.observer) {
271-
const result = this.observer.refetch(variables)
271+
const result = this.observer.refetch(variables).then((result) => {
272+
if (!result.loading) {
273+
this.loadingDone()
274+
}
275+
})
272276
this.maySetLoading()
273277
return result
274278
}

0 commit comments

Comments
 (0)