Use getter

This commit is contained in:
Drew Gross
2016-03-24 20:59:50 -07:00
parent ec35c39724
commit 7cdf85b367
2 changed files with 3 additions and 3 deletions

View File

@@ -34,13 +34,13 @@ export class PushController extends AdaptableController {
} }
} }
pushIsAvailable() { get pushIsAvailable() {
return !!this.adapter; return !!this.adapter;
} }
sendPush(body = {}, where = {}, config, auth, wait) { sendPush(body = {}, where = {}, config, auth, wait) {
var pushAdapter = this.adapter; var pushAdapter = this.adapter;
if (!this.pushIsAvailable()) { if (!this.pushIsAvailable) {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED, throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
'Push adapter is not available'); 'Push adapter is not available');
} }

View File

@@ -26,7 +26,7 @@ export class FeaturesRouter extends PromiseRouter {
from: false, from: false,
}, },
push: { push: {
immediatePush: req.config.pushController.pushIsAvailable(), immediatePush: req.config.pushController.pushIsAvailable,
scheduledPush: false, scheduledPush: false,
storedPushData: false, storedPushData: false,
pushAudiences: false, pushAudiences: false,