Merge branch 'master' into bugs/ui-07

This commit is contained in:
bechi 2014-10-30 16:56:26 -03:00
commit 11ab17ec94
13 changed files with 67 additions and 81 deletions

View file

@ -2,9 +2,7 @@
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService) {
controllerUtils.redirIfLogged();
$scope.retreiving = true;
identityService.check($scope);
$scope.retreiving = false;
$scope.createProfile = function(form) {
if (form && form.$invalid) {

View file

@ -1,11 +1,11 @@
'use strict';
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService) {
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService, Compatibility) {
controllerUtils.redirIfLogged();
$scope.retreiving = true;
identityService.check($scope);
$scope.confirmedEmail = getParam('confirmed');
$scope.retreiving = false;
Compatibility.check($scope);
$scope.openProfile = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');

View file

@ -8,6 +8,8 @@ angular.module('copayApp.controllers').controller('ImportController',
$scope.hideAdv = true;
$scope.is_iOS = isMobile.iOS();
Compatibility.check($scope);
var reader = new FileReader();
var updateStatus = function(status) {
@ -65,7 +67,7 @@ angular.module('copayApp.controllers').controller('ImportController',
reader.onloadend = function(evt) {
if (evt.target.readyState == FileReader.DONE) { // DONE == 2
var encryptedObj = evt.target.result;
Compatibility.importEncryptedWallet($rootScope.iden, encryptedObj, $scope.password, {},
copay.Compatibility.importEncryptedWallet($rootScope.iden, encryptedObj, $scope.password, {},
function(err, wallet){
if (err) {
notification.error('Error', 'Could not read wallet. Please check your password');
@ -91,8 +93,13 @@ angular.module('copayApp.controllers').controller('ImportController',
var backupFile = $scope.file;
var backupText = form.backupText.$modelValue;
var backupOldWallet = form.backupOldWallet.$modelValue;
var password = form.password.$modelValue;
if (backupOldWallet) {
backupText = backupOldWallet.value;
}
if (!backupFile && !backupText) {
$scope.loading = false;
notification.error('Error', 'Please, select your backup file');
@ -104,11 +111,12 @@ angular.module('copayApp.controllers').controller('ImportController',
reader.readAsBinaryString(backupFile);
}
else {
Compatibility.importEncryptedWallet($rootScope.iden, backupText, $scope.password, {},
copay.Compatibility.importEncryptedWallet($rootScope.iden, backupText, $scope.password, {},
function(err, wallet){
if (err) {
notification.error('Error', 'Could not read wallet. Please check your password');
} else {
copay.Compatibility.deleteOldWallet(backupOldWallet);
controllerUtils.installWalletHandlers($scope, wallet);
controllerUtils.setFocusedWallet(wallet);
return;
@ -118,7 +126,7 @@ angular.module('copayApp.controllers').controller('ImportController',
try {
_importBackup(backupText);
} catch(e) {
Compatibility.importEncryptedWallet(backupText, $scope.password, $scope.skipPublicKeyRing, $scope.skipTxProposals);
copay.Compatibility.importEncryptedWallet(backupText, $scope.password, $scope.skipPublicKeyRing, $scope.skipTxProposals);
}
}
};