mirror of https://github.com/BTCPrivate/copay.git
add friendly message when the wallet is full
This commit is contained in:
parent
44d62f736f
commit
715a5b2bba
|
@ -67,6 +67,8 @@ angular.module('copay.signin').controller('SigninController',
|
|||
if (err || !w) {
|
||||
if (err === 'joinError')
|
||||
$rootScope.flashMessage = { message: 'Can not find peer'};
|
||||
else if (err === 'walletFull')
|
||||
$rootScope.flashMessage = { message: 'The wallet is full'};
|
||||
else if (err === 'badSecret')
|
||||
$rootScope.flashMessage = { message: 'Bad secret secret string', type: 'error'};
|
||||
else
|
||||
|
|
|
@ -200,8 +200,14 @@ WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphras
|
|||
self.network.cleanUp();
|
||||
self.network.start(opts, function() {
|
||||
self.network.connectTo(s.pubKey);
|
||||
|
||||
// This is a hack to reconize if the connection was rejected or the peer wasn't there.
|
||||
var connectedOnce = false;
|
||||
self.network.on('connected', function(sender, data) {
|
||||
connectedOnce = true;
|
||||
});
|
||||
self.network.on('onlyYou', function(sender, data) {
|
||||
return cb('joinError');
|
||||
return cb(connectedOnce ? 'walletFull' : 'joinError');
|
||||
});
|
||||
self.network.on('data', function(sender, data) {
|
||||
if (data.type ==='walletId') {
|
||||
|
|
|
@ -223,6 +223,7 @@ Network.prototype._setupConnectionHandlers = function(dataConn, toCopayerId) {
|
|||
|
||||
// The connecting peer send hello
|
||||
if(toCopayerId) {
|
||||
self.emit('connected');
|
||||
self._sendHello(toCopayerId);
|
||||
self._addConnectedCopayer(toCopayerId);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue