Addressed more PR comments.
This commit is contained in:
Родитель
2dddb06560
Коммит
3516619a84
|
@ -58,12 +58,8 @@ var CodePush = (function () {
|
||||||
};
|
};
|
||||||
CodePush.prototype.getCurrentPackage = function (packageSuccess, packageError) {
|
CodePush.prototype.getCurrentPackage = function (packageSuccess, packageError) {
|
||||||
NativeAppInfo.isPendingUpdate(function (pendingUpdate) {
|
NativeAppInfo.isPendingUpdate(function (pendingUpdate) {
|
||||||
if (pendingUpdate) {
|
var packageInfoFile = pendingUpdate ? LocalPackage.OldPackageInfoFile : LocalPackage.PackageInfoFile;
|
||||||
LocalPackage.getPackageInfoOrNull(LocalPackage.OldPackageInfoFile, packageSuccess, packageError);
|
LocalPackage.getPackageInfoOrNull(packageInfoFile, packageSuccess, packageError);
|
||||||
}
|
|
||||||
else {
|
|
||||||
LocalPackage.getPackageInfoOrNull(LocalPackage.PackageInfoFile, packageSuccess, packageError);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
CodePush.prototype.getPendingPackage = function (packageSuccess, packageError) {
|
CodePush.prototype.getPendingPackage = function (packageSuccess, packageError) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class CodePush extends CordovaPlugin {
|
||||||
Reporting.saveStatus(Reporting.Status.UPDATE_CONFIRMED, currentMetadata.label, currentMetadata.appVersion);
|
Reporting.saveStatus(Reporting.Status.UPDATE_CONFIRMED, currentMetadata.label, currentMetadata.appVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.codePushPackageManager.markUnconfirmedInstall(false);
|
this.codePushPackageManager.clearNotConfirmedInstall();
|
||||||
this.cleanOldPackageSilently();
|
this.cleanOldPackageSilently();
|
||||||
callbackContext.success();
|
callbackContext.success();
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ public class CodePush extends CordovaPlugin {
|
||||||
private void markUpdate() {
|
private void markUpdate() {
|
||||||
/* this flag will clear when reloading the plugin */
|
/* this flag will clear when reloading the plugin */
|
||||||
this.didUpdate = true;
|
this.didUpdate = true;
|
||||||
this.codePushPackageManager.markUnconfirmedInstall(true);
|
this.codePushPackageManager.markUnconfirmedInstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanOldPackageSilently() {
|
private void cleanOldPackageSilently() {
|
||||||
|
@ -260,7 +260,7 @@ public class CodePush extends CordovaPlugin {
|
||||||
this.codePushPackageManager.cleanDeployments();
|
this.codePushPackageManager.cleanDeployments();
|
||||||
this.codePushPackageManager.clearFailedUpdates();
|
this.codePushPackageManager.clearFailedUpdates();
|
||||||
this.codePushPackageManager.clearPendingInstall();
|
this.codePushPackageManager.clearPendingInstall();
|
||||||
this.codePushPackageManager.markUnconfirmedInstall(false);
|
this.codePushPackageManager.clearNotConfirmedInstall();
|
||||||
Reporting.saveStatus(Reporting.Status.STORE_VERSION, null, null);
|
Reporting.saveStatus(Reporting.Status.STORE_VERSION, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ public class CodePush extends CordovaPlugin {
|
||||||
Reporting.saveStatus(Reporting.Status.UPDATE_ROLLED_BACK, currentMetadata.label, currentMetadata.appVersion);
|
Reporting.saveStatus(Reporting.Status.UPDATE_ROLLED_BACK, currentMetadata.label, currentMetadata.appVersion);
|
||||||
|
|
||||||
/* revert application to the previous version */
|
/* revert application to the previous version */
|
||||||
this.codePushPackageManager.markUnconfirmedInstall(false);
|
this.codePushPackageManager.clearNotConfirmedInstall();
|
||||||
this.codePushPackageManager.revertToPreviousVersion();
|
this.codePushPackageManager.revertToPreviousVersion();
|
||||||
|
|
||||||
/* reload the previous version */
|
/* reload the previous version */
|
||||||
|
|
|
@ -96,12 +96,12 @@ public class CodePushPackageManager {
|
||||||
this.codePushPreferences.clearPendingInstall();
|
this.codePushPreferences.clearPendingInstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markUnconfirmedInstall(boolean unconfirmed) {
|
public void markUnconfirmedInstall() {
|
||||||
if (unconfirmed) {
|
this.codePushPreferences.saveNotConfirmedInstall();
|
||||||
this.codePushPreferences.saveNotConfirmedInstall();
|
}
|
||||||
} else {
|
|
||||||
this.codePushPreferences.clearNotConfirmedInstall();
|
public void clearNotConfirmedInstall() {
|
||||||
}
|
this.codePushPreferences.clearNotConfirmedInstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNotConfirmedInstall() {
|
public boolean isNotConfirmedInstall() {
|
||||||
|
|
|
@ -87,7 +87,7 @@ function setupScenario(scenarioPath: string): Q.Promise<void> {
|
||||||
console.log("Body: " + JSON.stringify(req.body));
|
console.log("Body: " + JSON.stringify(req.body));
|
||||||
|
|
||||||
if (!testMessageResponse) {
|
if (!testMessageResponse) {
|
||||||
console.log("Seding OK");
|
console.log("Sending OK");
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
} else {
|
} else {
|
||||||
console.log("Sending body: " + testMessageResponse);
|
console.log("Sending body: " + testMessageResponse);
|
||||||
|
|
|
@ -97,11 +97,8 @@ class CodePush implements CodePushCordovaPlugin {
|
||||||
*/
|
*/
|
||||||
public getCurrentPackage(packageSuccess: SuccessCallback<LocalPackage>, packageError?: ErrorCallback): void {
|
public getCurrentPackage(packageSuccess: SuccessCallback<LocalPackage>, packageError?: ErrorCallback): void {
|
||||||
NativeAppInfo.isPendingUpdate((pendingUpdate: boolean) => {
|
NativeAppInfo.isPendingUpdate((pendingUpdate: boolean) => {
|
||||||
if (pendingUpdate) {
|
var packageInfoFile = pendingUpdate ? LocalPackage.OldPackageInfoFile : LocalPackage.PackageInfoFile;
|
||||||
LocalPackage.getPackageInfoOrNull(LocalPackage.OldPackageInfoFile, packageSuccess, packageError);
|
LocalPackage.getPackageInfoOrNull(packageInfoFile, packageSuccess, packageError);
|
||||||
} else {
|
|
||||||
LocalPackage.getPackageInfoOrNull(LocalPackage.PackageInfoFile, packageSuccess, packageError);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче