re-configure mail apps on mail fqdn change
This commit is contained in:
@@ -71,6 +71,18 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
}
|
||||
};
|
||||
|
||||
// this is required because we need to rewrite the MAIL_SERVER_NAME env var
|
||||
$scope.reconfigureEmailApps = function () {
|
||||
var installedApps = Client.getInstalledApps();
|
||||
for (var i = 0; i < installedApps.length; i++) {
|
||||
if (!installedApps[i].manifest.addons.email) continue;
|
||||
|
||||
Client.repairApp(installedApps[i].id, { }, function (error) {
|
||||
if (error) console.error(error);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.mailLocation = {
|
||||
busy: false,
|
||||
error: null,
|
||||
@@ -91,6 +103,8 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
if (error) return console.error(error);
|
||||
if (!task) return;
|
||||
|
||||
$scope.reconfigureEmailApps();
|
||||
|
||||
$scope.mailLocation.taskId = task.id;
|
||||
$scope.mailLocation.updateStatus();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user