Do not show overwrite when creds are invalid

This commit is contained in:
Girish Ramakrishnan
2019-09-24 00:59:12 -07:00
parent 7946f5ee81
commit 89d3228077
2 changed files with 39 additions and 28 deletions
+10 -2
View File
@@ -181,8 +181,16 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
if (!data.overwriteDns) {
if (result.error || result.needsOverwrite) {
$scope.appInstall.needsOverwrite = true;
$scope.appInstall.error.location = result.error ? result.error.message : 'DNS Record already exists. Confirm that the domain is not in use for services external to Cloudron';
if (result.error) {
if (result.error.reason === ERROR.ACCESS_DENIED) {
$scope.appInstall.error.location = 'DNS credentials for ' + data.domain + ' are invalid. Update it in Domains & Certs view';
} else {
$scope.appInstall.error.location = result.error.message;
}
} else {
$scope.appInstall.error.location = 'DNS Record already exists. Confirm that the domain is not in use for services external to Cloudron';
$scope.appInstall.needsOverwrite = true;
}
$scope.appInstall.busy = false;
$scope.appInstallForm.location.$setPristine();
$('#appInstallLocationInput').focus();