From a3ece642733b228ba26e5db206ab3852d44f76fc Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 18 Apr 2017 14:41:02 -0700 Subject: [PATCH] getDnsConfig only if admin --- webadmin/src/js/main.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index 1f269232e..d68bf415f 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -70,12 +70,21 @@ angular.module('Application').controller('MainController', ['$scope', '$route', }; function runConfigurationChecks() { - // Check if all email DNS records are set up properly for non external DNS API Client.getDnsConfig(function (error, result) { if (error) return console.error(error); + // check if we have aws credentials if selfhosting + if ($scope.config.isCustomDomain) { + if (result.provider === 'route53' && (!result.accessKeyId || !result.secretAccessKey)) { + var actionScope = $scope.$new(true); + actionScope.action = '/#/certs'; + Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, 'error', actionScope); + } + } + if (result.provider === 'caas') return; + // Check if all email DNS records are set up properly only for non external DNS API Client.getEmailStatus(function (error, result) { if (error) return console.error(error); @@ -147,19 +156,6 @@ angular.module('Application').controller('MainController', ['$scope', '$route', $scope.initialized = true; - // check if we have aws credentials if selfhosting - if ($scope.config.isCustomDomain) { - Client.getDnsConfig(function (error, result) { - if (error) return console.error(error); - - if (result.provider === 'route53' && (!result.accessKeyId || !result.secretAccessKey)) { - var actionScope = $scope.$new(true); - actionScope.action = '/#/certs'; - Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, 'error', actionScope); - } - }); - } - if ($scope.user.admin) runConfigurationChecks(); }); });