Move uninstall confirm dialog to app page
This commit is contained in:
@@ -411,6 +411,33 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
}
|
||||
};
|
||||
|
||||
$scope.uninstall = {
|
||||
busy: false,
|
||||
error: {},
|
||||
|
||||
show: function () {
|
||||
$('#uninstallModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.uninstall.busy = true;
|
||||
|
||||
Client.uninstallApp($scope.app.id, function (error) {
|
||||
if (error && error.statusCode === 402) { // unpurchase failed
|
||||
Client.error('Relogin to Cloudron App Store');
|
||||
} else if (error) {
|
||||
Client.error(error);
|
||||
} else {
|
||||
$('#uninstallModal').modal('hide');
|
||||
Client.refreshAppCache($scope.app.id); // reflect the new app state immediately
|
||||
$location.path('/apps');
|
||||
}
|
||||
|
||||
$scope.uninstall.busy = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function fetchUsers(callback) {
|
||||
Client.getUsers(function (error, users) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user