Preferences: update wallet info beforeEnter

This commit is contained in:
Gustavo Maximiliano Cortez 2017-05-12 13:55:18 -03:00
parent e8a18c9eb4
commit 82879cca20
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
1 changed files with 7 additions and 4 deletions

View File

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