relax getter on loading (#237)
* relax getter on loading * fix setter as well
This commit is contained in:
committed by
Guillaume Chau
parent
c8f9f30482
commit
a9dffa3906
+2
-2
@@ -45,13 +45,13 @@ export default class SmartQuery extends SmartApollo {
|
||||
}
|
||||
|
||||
get loading () {
|
||||
return this.vm.$data.$apolloData ? this.vm.$data.$apolloData.queries[this.key].loading : this._loading
|
||||
return this.vm.$data.$apolloData && this.vm.$data.$apolloData.queries[this.key] ? this.vm.$data.$apolloData.queries[this.key].loading : this._loading
|
||||
}
|
||||
|
||||
set loading (value) {
|
||||
if (this._loading !== value) {
|
||||
this._loading = value
|
||||
if (this.vm.$data.$apolloData) {
|
||||
if (this.vm.$data.$apolloData && this.vm.$data.$apolloData.queries[this.key]) {
|
||||
this.vm.$data.$apolloData.queries[this.key].loading = value
|
||||
this.vm.$data.$apolloData.loading += value ? 1 : -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user