Skip to content

Commit ddce641

Browse files
author
Guillaume Chau
committed
fix: result not called with notifyOnNetworkStatusChange, closes #263
1 parent 28a8d57 commit ddce641

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/smart-query.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ export default class SmartQuery extends SmartApollo {
103103

104104
this.startQuerySubscription()
105105

106-
if (this.options.fetchPolicy !== 'no-cache') {
106+
if (this.options.fetchPolicy !== 'no-cache' || this.options.notifyOnNetworkStatusChange) {
107107
const currentResult = this.maySetLoading()
108108

109-
if (!currentResult.loading) {
109+
if (!currentResult.loading || this.options.notifyOnNetworkStatusChange) {
110110
this.nextResult(currentResult)
111111
}
112112
}
@@ -150,7 +150,7 @@ export default class SmartQuery extends SmartApollo {
150150

151151
const hasResultCallback = typeof this.options.result === 'function'
152152

153-
if (typeof data === 'undefined') {
153+
if (data == null) {
154154
// No result
155155
} else if (!this.options.manual) {
156156
if (typeof this.options.update === 'function') {

0 commit comments

Comments
 (0)