diff --git a/src/views/app.js b/src/views/app.js index ac41b3eec..798285367 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -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: