fix/import

This commit is contained in:
Matias Alejo Garcia 2014-11-11 13:58:48 -03:00
commit 69daee6ed1
2 changed files with 10 additions and 5 deletions

View file

@ -28,8 +28,7 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
passphraseConfig: config.passphraseConfig, passphraseConfig: config.passphraseConfig,
}, function(err, iden) { }, function(err, iden) {
if (err && !iden) { if (err && !iden) {
controllerUtils.onErrorDigest( $scope.error = (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error';
$scope, (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error');
} else { } else {
notification.info('Success', 'Profile imported successfully'); notification.info('Success', 'Profile imported successfully');
$location.path('/'); $location.path('/');
@ -59,7 +58,7 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
if (form.$invalid) { if (form.$invalid) {
$scope.loading = false; $scope.loading = false;
notification.error('Error', 'There is an error in the form.'); $scope.error = 'Please enter the required fields';
return; return;
} }
@ -69,8 +68,7 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
if (!backupFile && !backupText) { if (!backupFile && !backupText) {
$scope.loading = false; $scope.loading = false;
notification.error('Error', 'Please, select your backup file'); $scope.error = 'Please, select your backup file';
$scope.loading = false;
return; return;
} }

View file

@ -10,6 +10,13 @@
<h1><span translate>Import Profile<span></h1> <h1><span translate>Import Profile<span></h1>
<form name="importProfileForm" ng-submit="import(importProfileForm)" novalidate> <form name="importProfileForm" ng-submit="import(importProfileForm)" novalidate>
<p class="text-warning size-12"
ng-show="error">
<i class="fi-x"></i>
{{error|translate}}
</p>
<div ng-show="!is_iOS"> <div ng-show="!is_iOS">
<legend for="backupFile" class="m10b"> <legend for="backupFile" class="m10b">
<span translate>Choose backup file from your computer</span> <i class="fi-laptop"></i> <span translate>Choose backup file from your computer</span> <i class="fi-laptop"></i>