Move the refresh functions
This commit is contained in:
+19
-13
@@ -79,6 +79,15 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
domain: null,
|
||||
subdomain: '',
|
||||
|
||||
refresh: function () {
|
||||
Client.getMailLocation(function (error, location) {
|
||||
if (error) return console.error('Failed to get max email location', error);
|
||||
|
||||
$scope.mailLocation.currentLocation.subdomain = location.subdomain;
|
||||
$scope.mailLocation.currentLocation.domain = $scope.domains.find(function (d) { return location.domain === d.domain; });
|
||||
});
|
||||
},
|
||||
|
||||
show: function () {
|
||||
$scope.mailLocation.busy = false;
|
||||
$scope.mailLocation.error = null;
|
||||
@@ -118,6 +127,14 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
size: 0,
|
||||
currentSize: 0,
|
||||
|
||||
refresh: function () {
|
||||
Client.getMaxEmailSize(function (error, size) {
|
||||
if (error) return console.error('Failed to get max email size', error);
|
||||
|
||||
$scope.maxEmailSize.currentSize = size;
|
||||
});
|
||||
},
|
||||
|
||||
show: function() {
|
||||
$scope.maxEmailSize.busy = false;
|
||||
$scope.maxEmailSize.error = null;
|
||||
@@ -291,12 +308,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
});
|
||||
});
|
||||
|
||||
Client.getMaxEmailSize(function (error, size) {
|
||||
if (error) return console.error('Failed to get max email size', error);
|
||||
|
||||
$scope.maxEmailSize.currentSize = size;
|
||||
});
|
||||
|
||||
$scope.maxEmailSize.refresh();
|
||||
$scope.spamConfig.refresh();
|
||||
});
|
||||
}
|
||||
@@ -310,13 +322,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
|
||||
if ($scope.user.role === 'owner') $scope.activity.refresh();
|
||||
|
||||
Client.getMailLocation(function (error, location) {
|
||||
if (error) return console.error('Failed to get max email location', error);
|
||||
|
||||
$scope.mailLocation.currentLocation.subdomain = location.subdomain;
|
||||
$scope.mailLocation.currentLocation.domain = $scope.domains.find(function (d) { return location.domain === d.domain; });
|
||||
});
|
||||
|
||||
$scope.mailLocation.refresh();
|
||||
refreshDomainStatuses();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user