Merge pull request #244 from cmgustavo/matias/feat/cash2-02
Clear history after return home
This commit is contained in:
commit
36340f7df9
1 changed files with 14 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('cashScanController',
|
angular.module('copayApp.controllers').controller('cashScanController',
|
||||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, txFormatService, bwcError, pushNotificationsService, bwcService) {
|
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $ionicHistory, $window, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, txFormatService, bwcError, pushNotificationsService, bwcService) {
|
||||||
var wallet;
|
var wallet;
|
||||||
var errors = bwcService.getErrors();
|
var errors = bwcService.getErrors();
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
|
|
@ -11,6 +11,17 @@ angular.module('copayApp.controllers').controller('cashScanController',
|
||||||
updateAllWallets();
|
updateAllWallets();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var goHome = function() {
|
||||||
|
$ionicHistory.nextViewOptions({
|
||||||
|
disableAnimate: true,
|
||||||
|
historyRoot: true
|
||||||
|
});
|
||||||
|
$ionicHistory.clearHistory();
|
||||||
|
$state.go('tabs.settings').then(function() {
|
||||||
|
$state.transitionTo('tabs.home');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var updateAllWallets = function() {
|
var updateAllWallets = function() {
|
||||||
var walletsBTC = profileService.getWallets({
|
var walletsBTC = profileService.getWallets({
|
||||||
coin: 'btc',
|
coin: 'btc',
|
||||||
|
|
@ -19,7 +30,7 @@ angular.module('copayApp.controllers').controller('cashScanController',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (lodash.isEmpty(walletsBTC)) {
|
if (lodash.isEmpty(walletsBTC)) {
|
||||||
$state.go('tabs.home');
|
goHome();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,7 +168,7 @@ angular.module('copayApp.controllers').controller('cashScanController',
|
||||||
if (isNew)
|
if (isNew)
|
||||||
walletService.startScan(newWallet, function() {});
|
walletService.startScan(newWallet, function() {});
|
||||||
|
|
||||||
$state.go('tabs.home');
|
goHome();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue