Disable swipe to back to avoid cancel while confirming

This commit is contained in:
Gustavo Maximiliano Cortez 2017-05-15 14:26:49 -03:00
commit d5b0f5c7f3
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
6 changed files with 55 additions and 7 deletions

View file

@ -1,10 +1,10 @@
'use strict';
angular.module('copayApp.controllers').controller('buyAmazonController', function($scope, $log, $state, $timeout, $filter, $ionicHistory, lodash, amazonService, popupService, profileService, ongoingProcess, configService, walletService, payproService, bwcError, externalLinkService, platformInfo) {
angular.module('copayApp.controllers').controller('buyAmazonController', function($scope, $log, $state, $timeout, $filter, $ionicHistory, $ionicConfig, lodash, amazonService, popupService, profileService, ongoingProcess, configService, walletService, payproService, bwcError, externalLinkService, platformInfo) {
var amount;
var currency;
$scope.isCordova = platformInfo.isCordova;
$scope.isCordova = platformInfo.isCordova;
$scope.openExternalLink = function(url) {
externalLinkService.open(url);
@ -98,6 +98,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController', functio
'leading': true
});
$scope.$on("$ionicView.beforeLeave", function(event, data) {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.$on("$ionicView.enter", function(event, data) {
$ionicConfig.views.swipeBackEnabled(false);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
amount = data.stateParams.amount;
currency = data.stateParams.currency;