Remove subscription setup modal, instead open cloudron.io directly

This commit is contained in:
Johannes Zellner
2020-02-14 14:16:04 +01:00
parent 9fcd049bdc
commit 21e7190b72
3 changed files with 34 additions and 73 deletions

View File

@@ -34,11 +34,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.update.error.generic = null;
$scope.update.busy = false;
if (!$scope.config.update.box.sourceTarballUrl) {
$('#setupSubscriptionModal').modal('show');
} else {
$('#updateModal').modal('show');
}
$('#updateModal').modal('show');
},
stopUpdate: function () {
@@ -359,18 +355,10 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
}
$scope.pollSubscriptionStatus = function () {
Client.getSubscription(function (error, result) {
if (error && error.statusCode === 412) return; // not yet registered
if (error) return console.error(error);
if (!$scope.$parent) return; // user changed view. otherwise we get an error that $scope.$parent is null
if (!$scope.$parent) return; // user changed view. otherwise we get an error that $scope.$parent is null
$scope.subscription = result;
// also reload the subscription on the main controller
$scope.$parent.updateSubscriptionStatus();
$timeout($scope.pollSubscriptionStatus, 10 * 1000);
});
// poll on the main controller
$scope.$parent.pollSubscriptionStatus();
};
$('#avatarFileInput').get(0).onchange = function (event) {