2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-09-05 00:35:29 +00:00

stop duplicate zone creation bug (#307)

This commit is contained in:
Britney Wright
2018-10-29 16:56:57 -04:00
committed by GitHub
parent bfb8aa7117
commit 4ca1bcbaf8

View File

@@ -96,15 +96,25 @@ angular.module('controller.zones', [])
/* Set total number of zones */
$scope.addZoneConnection = function () {
if ($scope.processing) {
$log.log('zoneConnection::processing is true; exiting');
return;
}
//flag to prevent multiple clicks until previous promise has resolved.
$scope.processing = true;
zonesService.sendZone($scope.currentZone)
.then(function () {
$timeout($scope.refreshZones(), 1000);
$("#zone_connection_modal").modal("hide");
$scope.processing = false;
})
.catch(function (error){
$("#zone_connection_modal").modal("hide");
$scope.zoneError = true;
handleError(error, 'zonesService::sendZone-failure');
$scope.processing = false;
});
};