Preferences: update wallet info beforeEnter

This commit is contained in:
Gustavo Maximiliano Cortez 2017-05-12 13:55:18 -03:00
commit 82879cca20
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -1,10 +1,9 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesController', angular.module('copayApp.controllers').controller('preferencesController',
function($scope, $rootScope, $timeout, $log, $stateParams, $ionicHistory, configService, profileService, fingerprintService, walletService) { function($scope, $rootScope, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService) {
var wallet = profileService.getWallet($stateParams.walletId); var wallet;
var walletId = wallet.credentials.walletId; var walletId;
$scope.wallet = wallet;
$scope.encryptEnabled = { $scope.encryptEnabled = {
value: walletService.isEncrypted(wallet) value: walletService.isEncrypted(wallet)
@ -78,6 +77,10 @@ angular.module('copayApp.controllers').controller('preferencesController',
}; };
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
wallet = profileService.getWallet(data.stateParams.walletId);
walletId = wallet.credentials.walletId;
$scope.wallet = wallet;
$scope.externalSource = null; $scope.externalSource = null;
if (!wallet) if (!wallet)