Removes function showAlert

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-01 11:11:40 -03:00
commit 50fdeff138
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 13 additions and 42 deletions

View file

@ -1,22 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('addressbookModalController', function($scope, $log, $state, $timeout, $ionicPopup, addressbookService, lodash) {
angular.module('copayApp.controllers').controller('addressbookModalController', function($scope, $log, $state, $timeout, $ionicPopup, addressbookService, lodash, popupService) {
var contacts;
// An alert dialog
var showAlert = function(title, msg, cb) {
$log.warn(title + ": " + msg);
var alertPopup = $ionicPopup.alert({
title: title,
template: msg
});
if (!cb) cb = function() {};
alertPopup.then(cb);
};
$scope.initAddressbook = function() {
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
@ -94,7 +81,7 @@ angular.module('copayApp.controllers').controller('addressbookModalController',
$timeout(function() {
addressbookService.add(addressbook, function(err, ab) {
if (err) {
showAlert(err);
popupService.showAlert(err);
return;
}
$scope.initAddressbook();
@ -108,7 +95,7 @@ angular.module('copayApp.controllers').controller('addressbookModalController',
$timeout(function() {
addressbookService.remove(addr, function(err, ab) {
if (err) {
showAlert(err);
popupService.showAlert(err);
return;
}
$scope.initAddressbook();