From c8ecee01d6abc6b32594d7ff42306fe9fd2632f9 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Thu, 25 Jan 2018 11:35:19 -0600 Subject: [PATCH] fix(pro): Tweak to pro plugin. #2136 #2127 --- src/@ionic-native/plugins/pro/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/pro/index.ts b/src/@ionic-native/plugins/pro/index.ts index bbdb6258e..776f0f9a9 100644 --- a/src/@ionic-native/plugins/pro/index.ts +++ b/src/@ionic-native/plugins/pro/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core'; +import { Plugin, Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; /** @@ -130,10 +130,16 @@ export class ProDeploy { }) @Injectable() export class Pro extends IonicNativePlugin { + _deploy: ProDeploy; + /** * Ionic Pro Deploy .js API. */ - deploy: ProDeploy = new ProDeploy((Pro.getPlugin() || {}).deploy); + @CordovaCheck() + deploy(): ProDeploy { + if (this._deploy) return this._deploy; + else return this._deploy = new ProDeploy(Pro.getPlugin().deploy); + } /** * Not yet implemented