show error message after click
This commit is contained in:
parent
6b65517383
commit
7540ee0a65
4 changed files with 45 additions and 33 deletions
|
|
@ -58,13 +58,13 @@
|
|||
<div ng-if="!gettingAddress">
|
||||
<ul class="no-bullet">
|
||||
<li class="line-b" ng-repeat="w in wallets">
|
||||
<a ng-click="w.needsBackup || selectWallet(w.id, w.name)" class="db oh">
|
||||
<a ng-click="selectWallet(w.id, w.name)" class="db oh">
|
||||
<div class="avatar-wallet"
|
||||
ng-style="{'background-color':w.color}">
|
||||
<i class="icon-wallet size-21"></i>
|
||||
</div>
|
||||
<div class="ellipsis name-wallet text-bold">{{w.name || w.id}}
|
||||
<span class="has-error right text-light size-12" ng-show="w.needsBackup">
|
||||
<span class="has-error right text-light size-12" ng-show="needsBackup[w.id]">
|
||||
<i class="icon-close-circle size-14"></i>
|
||||
<span class="vm" translate>Needs backup</span>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.isPrivKeyEncrypted = fc.isPrivKeyEncrypted();
|
||||
self.externalSource = fc.getPrivKeyExternalSourceName();
|
||||
self.account = fc.credentials.account;
|
||||
self.needsBackup = profileService.isBackupNeeded(self.walletId);
|
||||
|
||||
if (self.externalSource == 'trezor')
|
||||
self.account++;
|
||||
|
|
@ -153,16 +152,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
}
|
||||
}
|
||||
|
||||
self.openWallet(function() {
|
||||
if (!self.isComplete) {
|
||||
$log.debug('Wallet not complete after update... redirecting');
|
||||
go.path('copayers');
|
||||
} else {
|
||||
if ($state.is('copayers')) {
|
||||
$log.debug('Wallet Complete after update... redirect to home');
|
||||
go.walletHome();
|
||||
profileService.isBackupNeeded(self.walletId, function(needsBackup) {
|
||||
self.needsBackup = needsBackup;
|
||||
self.openWallet(function() {
|
||||
if (!self.isComplete) {
|
||||
$log.debug('Wallet not complete after update... redirecting');
|
||||
go.path('copayers');
|
||||
} else {
|
||||
if ($state.is('copayers')) {
|
||||
$log.debug('Wallet Complete after update... redirect to home');
|
||||
go.walletHome();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -1489,7 +1491,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
});
|
||||
|
||||
//untilItChange FALSE
|
||||
//untilItChange FALSE
|
||||
lodash.each(['NewTxProposal', 'TxProposalFinallyRejected', 'TxProposalRemoved', 'NewOutgoingTxByThirdParty',
|
||||
'Local/GlideraTx'
|
||||
], function(eventName) {
|
||||
|
|
|
|||
|
|
@ -246,21 +246,28 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
};
|
||||
|
||||
$scope.selectWallet = function(walletId, walletName) {
|
||||
$scope.gettingAddress = true;
|
||||
$scope.selectedWalletName = walletName;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
addressService.getAddress(walletId, false, function(err, addr) {
|
||||
$scope.gettingAddress = false;
|
||||
profileService.isBackupNeeded(walletId, function(needsBackup) {
|
||||
$scope.needsBackup = {};
|
||||
$scope.needsBackup[walletId] = needsBackup;
|
||||
if (needsBackup) return;
|
||||
|
||||
if (err) {
|
||||
self.error = err;
|
||||
$modalInstance.dismiss('cancel');
|
||||
return;
|
||||
}
|
||||
$scope.gettingAddress = true;
|
||||
$scope.selectedWalletName = walletName;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$modalInstance.close(addr);
|
||||
addressService.getAddress(walletId, false, function(err, addr) {
|
||||
$scope.gettingAddress = false;
|
||||
|
||||
if (err) {
|
||||
self.error = err;
|
||||
$modalInstance.dismiss('cancel');
|
||||
return;
|
||||
}
|
||||
|
||||
$modalInstance.close(addr);
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -668,12 +668,16 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.isBackupNeeded = function(walletId) {
|
||||
root.isBackupNeeded = function(walletId, cb) {
|
||||
var c = root.getClient(walletId);
|
||||
if (c.isPrivKeyExternal()) return false;
|
||||
if (!c.credentials.mnemonic) return false;
|
||||
if (c.credentials.network == 'testnet') return false;
|
||||
return true;
|
||||
if (c.isPrivKeyExternal()) return cb(false);
|
||||
if (!c.credentials.mnemonic) return cb(false);
|
||||
if (c.credentials.network == 'testnet') return cb(false);
|
||||
|
||||
storageService.getBackupFlag(walletId, function(err, val) {
|
||||
if (err || val) return cb(false);
|
||||
return cb(true);
|
||||
});
|
||||
};
|
||||
|
||||
root.getWallets = function(network) {
|
||||
|
|
@ -690,8 +694,7 @@ angular.module('copayApp.services')
|
|||
id: c.walletId,
|
||||
network: c.network,
|
||||
color: config.colorFor[c.walletId] || '#4A90E2',
|
||||
copayerId: c.copayerId,
|
||||
needsBackup: root.isBackupNeeded(c.walletId)
|
||||
copayerId: c.copayerId
|
||||
};
|
||||
});
|
||||
if (network) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue