Skip to content

Commit c8ecee0

Browse files
committed
fix(pro): Tweak to pro plugin. #2136 #2127
1 parent eaa87fa commit c8ecee0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/@ionic-native/plugins/pro/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { Plugin, Cordova, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
2+
import { Plugin, Cordova, CordovaCheck, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
33
import { Observable } from 'rxjs/Observable';
44

55
/**
@@ -130,10 +130,16 @@ export class ProDeploy {
130130
})
131131
@Injectable()
132132
export class Pro extends IonicNativePlugin {
133+
_deploy: ProDeploy;
134+
133135
/**
134136
* Ionic Pro Deploy .js API.
135137
*/
136-
deploy: ProDeploy = new ProDeploy((Pro.getPlugin() || {}).deploy);
138+
@CordovaCheck()
139+
deploy(): ProDeploy {
140+
if (this._deploy) return this._deploy;
141+
else return this._deploy = new ProDeploy(Pro.getPlugin().deploy);
142+
}
137143

138144
/**
139145
* Not yet implemented

0 commit comments

Comments
 (0)