fixes error when mnemonic is empty

This commit is contained in:
Matias Alejo Garcia 2016-12-28 16:49:42 -03:00
commit 70eb80aae8
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
4 changed files with 6 additions and 6 deletions

View file

@ -24,14 +24,12 @@ angular.module('copayApp.controllers').controller('importController',
$scope.seedOptions = [];
if (isChromeApp) {
if (isChromeApp || isDevel) {
$scope.seedOptions.push({
id: 'ledger',
label: 'Ledger Hardware Wallet',
});
}
if (isChromeApp || isDevel) {
$scope.seedOptions.push({
id: 'trezor',
label: 'Trezor Hardware Wallet',
@ -281,14 +279,14 @@ angular.module('copayApp.controllers').controller('importController',
};
$scope.importHW = function(form) {
if (form.$invalid || $scope.formData.ccount < 0) {
if (form.$invalid || $scope.formData.account < 0) {
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('There is an error in the form'));
return;
}
$scope.importErr = false;
var account = $scope.formData.ccount;
var account = $scope.formData.account;
if ($scope.seedSource.id == 'trezor') {
if (account < 1) {

View file

@ -636,6 +636,7 @@ angular.module('copayApp.services')
};
root._normalizeMnemonic = function(words) {
if (!words || !words.indexOf) return words;
var isJA = words.indexOf('\u3000') > -1;
var wordList = words.split(/[\u3000\s]+/);