repair: reinstall if no backup

This commit is contained in:
Girish Ramakrishnan
2021-04-05 10:22:43 -07:00
parent ae36ce07d1
commit da008874dc

View File

@@ -1411,7 +1411,11 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
// this also happens for import faliures. this UI can only show backup listing. use CLI for arbit id/config
case ISTATES.PENDING_RESTORE:
repairFunc = Client.restoreApp.bind(null, $scope.app.id, $scope.repair.backupId);
if ($scope.repair.backups.length === 0) { // this can happen when you give some invalid backup via CLI and restore via UI
repairFunc = Client.repairApp.bind(null, $scope.app.id, {}); // this will trigger a re-install
} else {
repairFunc = Client.restoreApp.bind(null, $scope.app.id, $scope.repair.backupId);
}
break;
case ISTATES.PENDING_UNINSTALL: