2016-08-10 15:29:31 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
angular.module('copayApp.controllers').controller('preferencesBitpayCardController',
|
2016-09-28 21:09:41 -03:00
|
|
|
function($scope, $state, $timeout, $ionicHistory, bitpayCardService, popupService) {
|
2016-08-10 15:29:31 -03:00
|
|
|
|
2016-09-06 15:14:07 -03:00
|
|
|
$scope.logout = function() {
|
|
|
|
|
var title = 'Are you sure you would like to log out of your Bitpay Card account?';
|
2016-09-12 13:58:36 -03:00
|
|
|
popupService.showConfirm(title, null, null, null, function(res) {
|
2016-09-06 15:14:07 -03:00
|
|
|
if (res) logout();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var logout = function() {
|
|
|
|
|
bitpayCardService.logout(function() {
|
2016-09-28 21:09:41 -03:00
|
|
|
$ionicHistory.removeBackView();
|
2016-09-06 15:14:07 -03:00
|
|
|
$timeout(function() {
|
2016-09-28 21:09:41 -03:00
|
|
|
$state.go('tabs.home');
|
2016-09-06 15:14:07 -03:00
|
|
|
}, 100);
|
2016-08-10 15:29:31 -03:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
});
|