fix: $apollo null error if smar obj is destroyed but has throttled/debounced calls
This commit is contained in:
@@ -98,6 +98,7 @@ export default class SmartApollo {
|
||||
const queryCb = this.initialOptions[prop].bind(this.vm)
|
||||
this.options[prop] = queryCb()
|
||||
let cb = query => {
|
||||
if (this._destroyed) return
|
||||
this.options[prop] = query
|
||||
this.refresh()
|
||||
}
|
||||
|
||||
@@ -94,6 +94,8 @@ export default class SmartQuery extends SmartApollo {
|
||||
}
|
||||
|
||||
executeApollo (variables) {
|
||||
if (this._destroyed) return
|
||||
|
||||
const variablesJson = JSON.stringify(variables)
|
||||
|
||||
if (this.sub) {
|
||||
|
||||
@@ -28,6 +28,8 @@ export default class SmartSubscription extends SmartApollo {
|
||||
}
|
||||
|
||||
executeApollo (variables) {
|
||||
if (this._destroyed) return
|
||||
|
||||
const variablesJson = JSON.stringify(variables)
|
||||
if (this.sub) {
|
||||
// do nothing if subscription is already running using exactly the same variables
|
||||
|
||||
Reference in New Issue
Block a user