diff --git a/js/models/Profile.js b/js/models/Profile.js index 5b5692aa6..c050cdedc 100644 --- a/js/models/Profile.js +++ b/js/models/Profile.js @@ -148,10 +148,18 @@ Profile.prototype.setLastFocusedTs = function(walletId, cb) { Profile.prototype.getLastFocusedWallet = function() { var self = this; + var last; var maxTs = _.max(_.pluck(self.walletInfos, 'lastFocusedTs')); - var last = _.findWhere(_.values(self.walletInfos), { + var wallets = _.values(self.walletInfos); + + last = _.findWhere(wallets, { lastFocusedTs: maxTs }); + + if (!last) { + last = _.last(wallets); + } + return last ? last.id : null; }; diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index f8187f2b3..bbdf65a7e 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -1,5 +1,5 @@
-
+
P