Wallet/src/js/controllers/modals/txStatus.js
Gustavo Maximiliano Cortez 96f961e38f
Bug fixes
2016-09-23 18:08:11 -03:00

37 lines
1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $ionicHistory, $log, addressbookService) {
if ($scope.cb) $timeout($scope.cb, 100);
$scope.fromSendTab = $ionicHistory.viewHistory().backView.stateName === "tabs.send.amount" || "tabs.send";
$scope.cancel = function() {
$scope.txStatusModal.hide();
if ($scope.fromSendTab) {
$ionicHistory.removeBackView();
$state.go('tabs.home');
}
};
$scope.save = function(addressbookEntry) {
$scope.txStatusModal.hide();
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true
});
$ionicHistory.removeBackView();
$state.go('tabs.send.addressbook', {
fromSendTab: true,
addressbookEntry: addressbookEntry
});
}
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
if (ab[$scope.tx.toAddress]) {
$scope.entryExist = true;
$log.debug('Entry already exist');
}
})
});