From 7ebc14d2175e0377b6cb88f3a8cf499169f39844 Mon Sep 17 00:00:00 2001 From: Manuel Kallenbach Date: Sun, 18 Jun 2017 18:26:16 +0200 Subject: [PATCH 1/2] fix refetch + watchLoading when no new results are returned --- src/smart-apollo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/smart-apollo.js b/src/smart-apollo.js index 3dca9c4..b4e9d14 100644 --- a/src/smart-apollo.js +++ b/src/smart-apollo.js @@ -264,7 +264,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 === false) { + this.loadingDone() + } + }) this.maySetLoading() return result } From 709fcd999befcf1fa973bdc032b9f1829f577fbd Mon Sep 17 00:00:00 2001 From: Manuel Kallenbach Date: Mon, 26 Jun 2017 18:29:55 +0200 Subject: [PATCH 2/2] use !result.loading instead of result.loading === false --- src/smart-apollo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/smart-apollo.js b/src/smart-apollo.js index b4e9d14..609f18c 100644 --- a/src/smart-apollo.js +++ b/src/smart-apollo.js @@ -265,7 +265,7 @@ export class SmartQuery extends SmartApollo { variables && (this.options.variables = variables) if (this.observer) { const result = this.observer.refetch(variables).then((result) => { - if (result.loading === false) { + if (!result.loading) { this.loadingDone() } })