From a3590dfa262d0113a354591676942e05c20b5cbf Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 14:01:34 -0700 Subject: [PATCH] Bodge to default to '1 users' when you create a room, which is better than blindly assuming a recents controller is writing to rootScope.rooms and setting numUsersInRoom there. --- webclient/recents/recents-controller.js | 5 +++++ webclient/recents/recents.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js index b4762acd1d..701c935742 100644 --- a/webclient/recents/recents-controller.js +++ b/webclient/recents/recents-controller.js @@ -82,6 +82,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand eventHandlerService.waitForInitialSyncCompletion().then( function(initialSyncData) { + // XXX FIXME TODO: + // Any assignments to the rootScope here should be done in + // event handler service and not here, because we could have + // many controllers manipulating and clobbering each other, and + // are unecessarily repeating http requests. var rooms = initialSyncData.data.rooms; for (var i=0; i - {{ room.numUsersInRoom }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }} + {{ room.numUsersInRoom || '1' }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }} {{ (room.lastMsg.ts) | date:'MMM d HH:mm' }}