Allow repair in non-errored state

This commit is contained in:
Girish Ramakrishnan
2019-09-22 21:56:07 -07:00
parent 9841351190
commit 217632354f
+1 -5
View File
@@ -667,11 +667,7 @@ function checkAppState(app, state) {
if (app.taskId) return new AppsError(AppsError.BAD_STATE, `Not allowed in this app state : ${app.installationState} / ${app.runState}`);
if (state === exports.ISTATE_PENDING_REPAIR) {
if (app.installationState !== exports.ISTATE_ERROR) return new AppsError(AppsError.BAD_STATE, 'Not allowed in error state');
} else {
if (app.installationState === exports.ISTATE_ERROR) return new AppsError(AppsError.BAD_STATE, 'Not allowed in error state');
}
if (state !== exports.ISTATE_PENDING_REPAIR && app.installationState === exports.ISTATE_ERROR) return new AppsError(AppsError.BAD_STATE, 'Not allowed in error state');
return null;
}