mirror of https://github.com/BTCPrivate/copay.git
fix order in events
This commit is contained in:
parent
494c21132a
commit
5e92ae96ac
|
@ -24,7 +24,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
||||||
}
|
}
|
||||||
$rootScope.starting = true;
|
$rootScope.starting = true;
|
||||||
identityService.open(form.email.$modelValue, form.password.$modelValue, function(err) {
|
identityService.open(form.email.$modelValue, form.password.$modelValue, function(err) {
|
||||||
console.log('[home.js.27]'); //TODO
|
|
||||||
$rootScope.starting = false;
|
$rootScope.starting = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
copay.logger.warn(err);
|
copay.logger.warn(err);
|
||||||
|
|
|
@ -33,7 +33,9 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.switchWallet = function(wid) {
|
$scope.switchWallet = function(wid) {
|
||||||
|
$scope.walletSelection = false;
|
||||||
identityService.setFocusedWallet(wid);
|
identityService.setFocusedWallet(wid);
|
||||||
|
identityService.goWalletHome();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.toggleWalletSelection = function() {
|
$scope.toggleWalletSelection = function() {
|
||||||
|
|
|
@ -185,7 +185,6 @@ Identity.prototype.openWallets = function() {
|
||||||
return va < vb ? 1 : (va === vb ? 0 : -1);
|
return va < vb ? 1 : (va === vb ? 0 : -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('[Identity.js.188]', self.walletIds, self.focusedTimestamps); //TODO
|
|
||||||
// opens the wallets, in the order they were last accessed. Emits open events (newWallet)
|
// opens the wallets, in the order they were last accessed. Emits open events (newWallet)
|
||||||
async.eachSeries(self.walletIds, function(walletId, a_cb) {
|
async.eachSeries(self.walletIds, function(walletId, a_cb) {
|
||||||
self.readAndBindWallet(walletId, a_cb);
|
self.readAndBindWallet(walletId, a_cb);
|
||||||
|
|
|
@ -109,7 +109,7 @@ angular.module('copayApp.services')
|
||||||
$location.path('/send');
|
$location.path('/send');
|
||||||
};
|
};
|
||||||
|
|
||||||
root.setFocusedWallet = function(w) {
|
root.setFocusedWallet = function(w, dontUpdateIt) {
|
||||||
if (!_.isObject(w))
|
if (!_.isObject(w))
|
||||||
w = $rootScope.iden.getWalletById(w);
|
w = $rootScope.iden.getWalletById(w);
|
||||||
preconditions.checkState(w && _.isObject(w));
|
preconditions.checkState(w && _.isObject(w));
|
||||||
|
@ -117,9 +117,10 @@ angular.module('copayApp.services')
|
||||||
copay.logger.debug('Set focus:', w.getName());
|
copay.logger.debug('Set focus:', w.getName());
|
||||||
$rootScope.wallet = w;
|
$rootScope.wallet = w;
|
||||||
|
|
||||||
$rootScope.iden.updateFocusedTimestamp(w.getId());
|
if (!dontUpdateIt)
|
||||||
pendingTxsService.update();
|
$rootScope.iden.updateFocusedTimestamp(w.getId());
|
||||||
|
|
||||||
|
pendingTxsService.update();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
})
|
})
|
||||||
|
@ -143,7 +144,7 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
w.on('ready', function() {
|
w.on('ready', function() {
|
||||||
var isFocused = root.isFocused(wid);
|
var isFocused = root.isFocused(wid);
|
||||||
console.log('GOT READY [identityService.js.184:isFocused:]', w.getName(), isFocused); //TODO
|
copay.logger.debug('Wallet:' + w.getName() + ' is ready. Focused:', isFocused);
|
||||||
|
|
||||||
balanceService.update(w, function() {
|
balanceService.update(w, function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
|
@ -252,15 +253,15 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
iden.on('newWallet', function(wid) {
|
iden.on('newWallet', function(wid) {
|
||||||
var w = iden.getWalletById(wid);
|
var w = iden.getWalletById(wid);
|
||||||
copay.logger.debug('newWallet:', w.getName());
|
copay.logger.debug('newWallet:', w.getName(), wid, iden.getLastFocusedWalletId());
|
||||||
root.installWalletHandlers(w);
|
root.installWalletHandlers(w);
|
||||||
w.netStart();
|
|
||||||
if (wid == iden.getLastFocusedWalletId()) {
|
if (wid == iden.getLastFocusedWalletId()) {
|
||||||
copay.logger.debug('GOT Focused wallet!', w.getName());
|
copay.logger.debug('GOT Focused wallet:', w.getName());
|
||||||
root.setFocusedWallet(w);
|
root.setFocusedWallet(w, true);
|
||||||
root.goWalletHome();
|
root.goWalletHome();
|
||||||
$rootScope.$digest()
|
|
||||||
}
|
}
|
||||||
|
// At the end (after all handlers are in place)...start the wallet.
|
||||||
|
w.netStart();
|
||||||
});
|
});
|
||||||
|
|
||||||
iden.on('noWallets', function() {
|
iden.on('noWallets', function() {
|
||||||
|
@ -273,7 +274,7 @@ angular.module('copayApp.services')
|
||||||
if ($rootScope.wallet.id === wid) {
|
if ($rootScope.wallet.id === wid) {
|
||||||
$rootScope.wallet = null;
|
$rootScope.wallet = null;
|
||||||
var lastFocused = iden.getLastFocusedWalletId();
|
var lastFocused = iden.getLastFocusedWalletId();
|
||||||
self.setFocusedWallet(lastFocused);
|
root.setFocusedWallet(lastFocused);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -304,7 +305,7 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.importProfile = function(str, password, cb){
|
root.importProfile = function(str, password, cb) {
|
||||||
copay.Identity.importFromEncryptedFullJson(str, password, {
|
copay.Identity.importFromEncryptedFullJson(str, password, {
|
||||||
pluginManager: pluginManager,
|
pluginManager: pluginManager,
|
||||||
network: config.network,
|
network: config.network,
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_4"> </div></div>
|
<div class="contener_mixte"><div class="ballcolor ball_4"> </div></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-gray size-12" translate>Accessing your profile...</span>
|
<span class="text-gray size-12" translate>Accessing your profile...</span>
|
||||||
13
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue