Only allow debug and uninstall views on app error

This commit is contained in:
Johannes Zellner
2019-09-22 12:10:44 +02:00
parent 25f9e7829f
commit a27e94f694
3 changed files with 20 additions and 8 deletions

View File

@@ -66,6 +66,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.setView = function (view) {
if ($scope.view === view) return;
// on error only allow uninstall or debug view
if ($scope.app.error && view !== 'uninstall') view = 'debug';
$route.updateParams({ view: view });
$scope[view].show();
$scope.view = view;
@@ -889,6 +892,8 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.app = app;
console.log(app.installationState, app.error);
$scope.setView($routeParams.view || 'display');
// track on page load backup if active