diff --git a/js/controllers/signin.js b/js/controllers/signin.js index ac079ca29..3558762a9 100644 --- a/js/controllers/signin.js +++ b/js/controllers/signin.js @@ -20,7 +20,6 @@ angular.module('copay.signin').controller('SigninController', console.log('[signin.js.23:walletId:]',walletId); //TODO var w = walletFactory.open(walletId, opts); controllerUtils.setupUxHandlers(w); - w.netStart(); }; $scope.join = function(secret) { @@ -34,7 +33,6 @@ console.log('[signin.js.23:walletId:]',walletId); //TODO walletFactory.joinCreateSession(secret, function(w) { console.log('[signin.js.33] joinCreateSession RETURN', w); //TODO controllerUtils.setupUxHandlers(w); - w.setupNetHandlers(); }); }; diff --git a/js/models/core/PrivateKey.js b/js/models/core/PrivateKey.js index bf8cfa9de..66102e8db 100644 --- a/js/models/core/PrivateKey.js +++ b/js/models/core/PrivateKey.js @@ -32,6 +32,8 @@ PrivateKey.fromObj = function(obj) { }; PrivateKey.prototype.toObj = function() { + +console.log('[PrivateKey.js.35] TODO TODO: PRIV: ', this.getExtendedPrivateKeyString()); //TODO return { extendedPrivateKeyString: this.getExtendedPrivateKeyString(), networkName: this.network.name, diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 881d55589..7b0efd813 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -106,9 +106,11 @@ Wallet.prototype._handleData = function(senderId, data, isInbound) { } this.log('[Wallet.js.98]' , data.type); //TODO switch(data.type) { + // This handler is repeaded on WalletFactory (#join). TODO + case 'walletId': + this.sendWalletReady(senderId); + break; case 'walletReady': - -console.log('[Wallet.js.109] RECV WALLETREADY'); //TODO this.sendPublicKeyRing(senderId); this.sendTxProposals(senderId); break; @@ -189,6 +191,7 @@ console.log('[Wallet.js.177] NET START: emit CREATED'); //TODO if (otherPeerId !== myPeerId) { net.connectTo(otherPeerId); } + self.emit('refresh'); } }, startOpts); }; diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 371e367ae..80d0f6c5c 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -34,7 +34,6 @@ console.log('[controllerUtils.js.30:created:] RECV '); //TODO $rootScope.wallet.getBalance(function(balance) { $rootScope.totalBalance = balance; - $rootScope.$digest(); }); }); w.on('refresh', function() { @@ -43,6 +42,8 @@ console.log('[controllerUtils.js.30:created:] RECV '); //TODO }); w.on('openError', root.onErrorDigest); w.on('close', root.onErrorDigest); + +console.log('[controllerUtils.js.45] CALLING NETSTART FROM setupUxHandlers'); //TODO w.netStart(); console.log('[controllerUtils.js.45] setupUxHandlers END'); //TODO };