mirror of https://github.com/BTCPrivate/copay.git
Fix back button for Android. Adds timeout and stop if error
This commit is contained in:
parent
ffb19e00b9
commit
b44b7eacad
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $log, $timeout, $http, $httpParamSerializer, profileService, configService, walletService, appConfigService) {
|
||||
angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $log, $timeout, $http, $httpParamSerializer, $ionicConfig, profileService, configService, walletService, appConfigService) {
|
||||
|
||||
var wallet, walletId;
|
||||
$scope.data = {};
|
||||
|
@ -18,6 +18,14 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
};
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function() {
|
||||
$ionicConfig.views.swipeBackEnabled(true);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function() {
|
||||
$ionicConfig.views.swipeBackEnabled(false);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
walletId = data.stateParams.walletId;
|
||||
wallet = profileService.getWallet(walletId);
|
||||
|
@ -47,11 +55,13 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
walletService.updateRemotePreferences(wallet, {
|
||||
email: $scope.data.email,
|
||||
}, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
if (err) return;
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
if ($scope.data.accept) collectEmail();
|
||||
$scope.goNextView();
|
||||
$timeout(function() {
|
||||
$scope.goNextView();
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue