From 05df942f81b76087bb72c5f80d6af1ee158c072b Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sun, 16 Feb 2014 17:30:00 -0500 Subject: [PATCH] Redirect to first activeBuffer name --- js/glowingbear.js | 10 +++++++--- templates/glowingbear.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 506e7c3..fb928fc 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -309,7 +309,14 @@ function($rootScope, // Switch to first buffer on startup if (i === 0) { models.setActiveBuffer(buffer.id); + // Set setActiveBuffer emits a signal (activeBufferChanged) + // The $rootScope.$on('activeBuffer...' should take care of + // changing the buffer. However, and for a reason that I ignore + // this signal is not sent on initialization + $rootScope.connected = true; + $location.path(buffer.fullName); } + } }); @@ -334,9 +341,6 @@ function($rootScope, weeChat.Protocol.formatSync({}) ); - $rootScope.connected = true; - $location.path('/connected'); - }; var onmessage = function(event) { diff --git a/templates/glowingbear.html b/templates/glowingbear.html index 16ffed1..5105b34 100644 --- a/templates/glowingbear.html +++ b/templates/glowingbear.html @@ -113,7 +113,7 @@
  • - + {{ content.shortName }}{{ content.fullName }}