Skip to content

Commit 7889a0d

Browse files
author
Guillaume Chau
committed
Fix data not updating if 'variables' changes and apollo doesn't need a request
1 parent 185104a commit 7889a0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/smart-apollo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ export class SmartQuery extends SmartApollo {
199199
})
200200
}
201201

202-
this.maySetLoading()
202+
const currentResult = this.maySetLoading()
203+
204+
if (!currentResult.loading) {
205+
this.nextResult(currentResult)
206+
}
203207

204208
super.executeApollo(variables)
205209
}
@@ -212,6 +216,7 @@ export class SmartQuery extends SmartApollo {
212216
}
213217
this.loading = true
214218
}
219+
return currentResult
215220
}
216221

217222
nextResult (result) {

0 commit comments

Comments
 (0)