@@ -58,14 +58,15 @@ export class AcquisitionStatus {
5858}
5959
6060export class AcquisitionManager {
61- private readonly BASER_URL_PART = "appcenter.ms"
61+ private readonly BASER_URL_PART = "appcenter.ms" ;
6262 private _appVersion : string ;
6363 private _clientUniqueId : string ;
6464 private _deploymentKey : string ;
6565 private _httpRequester : Http . Requester ;
6666 private _ignoreAppVersion : boolean ;
6767 private _serverUrl : string ;
6868 private _publicPrefixUrl : string = "v0.1/public/codepush/" ;
69+
6970 private static _apiCallsDisabled : boolean = false ;
7071 constructor ( httpRequester : Http . Requester , configuration : Configuration ) {
7172 this . _httpRequester = httpRequester ;
@@ -80,6 +81,7 @@ export class AcquisitionManager {
8081 this . _deploymentKey = configuration . deploymentKey ;
8182 this . _ignoreAppVersion = configuration . ignoreAppVersion ;
8283 }
84+
8385 // Used for Tests
8486 public static get apiCallsDisabled ( ) : boolean {
8587 return this . _apiCallsDisabled ;
@@ -93,7 +95,7 @@ export class AcquisitionManager {
9395
9496 public queryUpdateWithCurrentPackage ( currentPackage : Package , callback ?: Callback < RemotePackage | NativeUpdateNotification > ) : void {
9597 if ( AcquisitionManager . _apiCallsDisabled ) {
96- console . log ( `[CodePush] Api calls are disabled, skipping queryUpdateWithCurrentPackage ` ) ;
98+ console . log ( `[CodePush] Api calls are disabled, skipping API call ` ) ;
9799 callback ( /*error=*/ null , /*remotePackage=*/ null ) ;
98100 return ;
99101 }
@@ -166,7 +168,8 @@ export class AcquisitionManager {
166168
167169 public reportStatusDeploy ( deployedPackage ?: Package , status ?: string , previousLabelOrAppVersion ?: string , previousDeploymentKey ?: string , callback ?: Callback < void > ) : void {
168170 if ( AcquisitionManager . _apiCallsDisabled ) {
169- console . log ( `[CodePush] Api calls are disabled, skipping reportStatusDeploy` ) ;
171+ console . log ( `[CodePush] Api calls are disabled, skipping API call` ) ;
172+ callback ( null , null )
170173 return ;
171174 }
172175
@@ -232,7 +235,8 @@ export class AcquisitionManager {
232235
233236 public reportStatusDownload ( downloadedPackage : Package , callback ?: Callback < void > ) : void {
234237 if ( AcquisitionManager . _apiCallsDisabled ) {
235- console . log ( `[CodePush] Api calls are disabled, skipping reportStatusDownload` ) ;
238+ console . log ( `[CodePush] Api calls are disabled, skipping API call` ) ;
239+ callback ( null , null )
236240 return ;
237241 }
238242
@@ -255,6 +259,7 @@ export class AcquisitionManager {
255259 callback ( new CodePushHttpError ( response . statusCode + ": " + response . body ) , /*not used*/ null ) ;
256260 return ;
257261 }
262+
258263 callback ( /*error*/ null , /*not used*/ null ) ;
259264 }
260265 } ) ;
0 commit comments