maatma: avoid useless alert

This commit is contained in:
nemunaire 2019-03-25 23:43:09 +01:00
parent ddd8da6395
commit 4babb470cd

View File

@ -81,8 +81,9 @@ angular.module("AdLinApp")
$rootScope.checkLoginState(); $rootScope.checkLoginState();
$location.url("/"); $location.url("/");
}, function(response) { }, function(response) {
alert(response.data.errmsg);
$scope.pleaseWait = false; $scope.pleaseWait = false;
if (response.data && response.data.errmsg)
alert(response.data.errmsg);
}); });
} }
}) })
@ -111,6 +112,7 @@ angular.module("AdLinApp")
}).then(function(response) { }).then(function(response) {
$scope.tunnels = response.data; $scope.tunnels = response.data;
}, function(response) { }, function(response) {
if (response.data && response.data.errmsg)
alert(response.data.errmsg); alert(response.data.errmsg);
}); });
}; };
@ -130,8 +132,8 @@ angular.module("AdLinApp")
$scope.updateTunnelsList(); $scope.updateTunnelsList();
$scope.pleaseWaitNew = false; $scope.pleaseWaitNew = false;
}, function(response) { }, function(response) {
alert(response.data.errmsg);
$scope.pleaseWaitNew = false; $scope.pleaseWaitNew = false;
alert(response.data.errmsg);
}); });
} }
@ -148,8 +150,8 @@ angular.module("AdLinApp")
$scope.updateTunnelsList(); $scope.updateTunnelsList();
tunnel.pleaseWaitDrop = false; tunnel.pleaseWaitDrop = false;
}, function(response) { }, function(response) {
alert(response.data.errmsg);
tunnel.pleaseWaitDrop = false; tunnel.pleaseWaitDrop = false;
alert(response.data.errmsg);
}); });
} }
}) })
@ -224,8 +226,8 @@ angular.module("AdLinApp")
$scope.updateAssociationD(); $scope.updateAssociationD();
$scope.pleaseWaitNewAssociation = false; $scope.pleaseWaitNewAssociation = false;
}, function(response) { }, function(response) {
alert(response.data.errmsg);
$scope.pleaseWaitNewAssociation = false; $scope.pleaseWaitNewAssociation = false;
alert(response.data.errmsg);
}); });
} }