refactor - add spinner

This commit is contained in:
Javier 2016-06-28 17:29:47 -03:00
commit afc2598d59
5 changed files with 29 additions and 24 deletions

View file

@ -95,8 +95,8 @@
</div>
</div>
<div class="containter text-center p50t" ng-show="exportQR">
<qrcode size="220" version="10" error-correction-level="M" data="{{exportWalletInfo}}"></qrcode>
<div class="containter text-center" ng-show="exportQR">
<qrcode size="220" version="8" error-correction-level="M" data="{{exportWalletInfo}}"></qrcode>
<span translate></span>
</div>

View file

@ -69,7 +69,7 @@
<label for="passphrase" class="oh"><span translate>Password</span> <small translate>The Wallet Recovery Phrase could require a password to be imported</small>
<div class="input">
<input type="password" class="form-control" placeholder="{{'Password'|translate}}"
name="passphrase" ng-model="import.passphrase">
name="passphrase" ng-model="passphrase">
</div>
</label>

View file

@ -10,7 +10,6 @@ angular.module('copayApp.controllers').controller('exportController',
$scope.isCordova = platformInfo.isCordova;
$scope.isSafari = platformInfo.isSafari;
$scope.error = null;
console.log(fc.credentials);
$scope.init = function(state) {
$scope.QROpts = false;
@ -80,9 +79,7 @@ angular.module('copayApp.controllers').controller('exportController',
}
}
var code = info.type + '|' + c.network.charAt(0).toLowerCase() + '|' + info.data + '|' + c.account + '|' + c.derivationStrategy +
'|' + (c.mnemonicHasPassphrase || null);
return code;
return info.type + '|' + info.data;
};
$scope.downloadWalletBackup = function() {

View file

@ -36,35 +36,42 @@ angular.module('copayApp.controllers').controller('importController',
};
$scope.processCode = function(code) {
ongoingProcess.set('processingCode', true);
self.importErr = false;
var parsedCode = code.split('|');
var derivationStrategy = "44'";
var networkVal;
if (parsedCode.length != 2) {
ongoingProcess.set('processingCode', false);
return;
}
var info = {
type: parsedCode[0],
network: parsedCode[1],
data: parsedCode[2],
account: parsedCode[3],
derivationStrategy: parsedCode[4],
hasPassphrase: parsedCode[5]
data: parsedCode[1],
};
$scope.words = info.data;
var client = bwcService.getClient(null, null);
if (info.network == 't') {
networkVal = "1'";
$scope.testnetEnabled = true;
} else {
networkVal = "0'";
$scope.testnetEnabled = false;
if (info.type == 1) {
client.seedFromMnemonic(info.data, {});
}
if (info.type == 2) {
client.seedFromExtendedPrivateKey(info.data, {});
}
if (info.type == 3) {
client.seedFromExtendedPublicKey(info.data, {});
}
if (info.derivationStrategy == 'BIP45' || info.derivationStrategy == 'BIP48')
derivationStrategy = info.derivationStrategy.substring(3, 5) + "'";
$scope.words = info.data;
$scope.derivationPath = client.credentials.getBaseAddressDerivationPath();
$scope.derivationPath = "m/" + derivationStrategy + '/' + networkVal + '/' + info.account + "'";
if (client.credentials.network == 'testnet')
$scope.testnetEnabled = true;
else
$scope.testnetEnabled = false;
$timeout(function() {
ongoingProcess.set('processingCode', false);
$rootScope.$apply();
}, 1);
};

View file

@ -28,6 +28,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'importingWallet': gettext('Importing Wallet...'),
'sweepingWallet': gettext('Sweeping Wallet...'),
'deletingWallet': gettext('Deleting Wallet...'),
'processingCode': gettext('Processing code...'),
};
root.clear = function() {