diff --git a/src/@ionic-native/plugins/pro/index.ts b/src/@ionic-native/plugins/pro/index.ts index bbdb6258..776f0f9a 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