Merge pull request #319 from JDonadio/ref/password-and-advanced-options

Ref/password and advanced options
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-10 11:53:18 -03:00 committed by GitHub
commit 4f06b3f672
7 changed files with 147 additions and 78 deletions

View file

@ -37,9 +37,24 @@ angular.module('copayApp.controllers').controller('createController',
};
$scope.showAdvChange = function() {
$scope.showAdv = !$scope.showAdv;
$scope.resizeView();
};
$scope.resizeView = function() {
$timeout(function() {
$ionicScrollDelegate.resize();
}, 10);
});
checkPasswordFields();
};
function checkPasswordFields() {
if (!$scope.encrypt) {
$scope.formData.passphrase = $scope.formData.createPassphrase = $scope.formData.passwordSaved = null;
$timeout(function() {
$scope.$apply();
});
}
};
function updateRCSelect(n) {
@ -160,7 +175,6 @@ angular.module('copayApp.controllers').controller('createController',
function _create(opts) {
ongoingProcess.set('creatingWallet', true);
$timeout(function() {
profileService.createWallet(opts, function(err, client) {
ongoingProcess.set('creatingWallet', false);
if (err) {
@ -173,11 +187,12 @@ angular.module('copayApp.controllers').controller('createController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
});
if ($scope.seedSource.id == 'set') {
profileService.setBackupFlag(client.credentials.walletId);
}
$ionicHistory.removeBackView();
if (!client.isComplete()) {
$ionicHistory.nextViewOptions({
disableAnimate: true
@ -188,8 +203,7 @@ angular.module('copayApp.controllers').controller('createController',
walletId: client.credentials.walletId
});
}, 100);
}
else $state.go('tabs.home')
} else $state.go('tabs.home');
});
}, 100);
}

View file

@ -1,9 +1,20 @@
'use strict';
angular.module('copayApp.controllers').controller('exportController',
function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) {
function($scope, $timeout, $log, $ionicHistory, $ionicScrollDelegate, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.showAdvChange = function() {
$scope.showAdv = !$scope.showAdv;
$scope.resizeView();
};
$scope.resizeView = function() {
$timeout(function() {
$ionicScrollDelegate.resize();
});
};
var init = function() {
$scope.formData = {};
$scope.isEncrypted = wallet.isPrivKeyEncrypted();

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, $state, $ionicHistory, profileService, configService, storageService, applicationService, gettext, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) {
function($scope, $rootScope, $timeout, $state, $ionicHistory, $ionicScrollDelegate, profileService, configService, storageService, applicationService, gettext, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
@ -12,6 +12,26 @@ angular.module('copayApp.controllers').controller('joinController',
$scope.derivationPath = derivationPathHelper.default;
$scope.account = 1;
$scope.showAdvChange = function() {
$scope.showAdv = !$scope.showAdv;
$scope.resizeView();
};
$scope.resizeView = function() {
$timeout(function() {
$ionicScrollDelegate.resize();
});
checkPasswordFields();
};
function checkPasswordFields() {
if (!$scope.encrypt) {
$scope.passphrase = $scope.createPassphrase = $scope.passwordSaved = null;
$timeout(function() {
$scope.$apply();
});
}
};
this.onQrCodeScanned = function(data) {
$scope.secret = data;
@ -156,11 +176,10 @@ angular.module('copayApp.controllers').controller('joinController',
$state.transitionTo('tabs.copayers', {
walletId: client.credentials.walletId
});
}, 100);
}
else $state.go('tabs.home')
});
} else $state.go('tabs.home');
});
}, 100);
});
};
updateSeedSourceSelect();