Removes function showAlert
This commit is contained in:
parent
92bb8e01bc
commit
50fdeff138
2 changed files with 13 additions and 42 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue