From 3407e9ad36bbbc9c874a0627742d714bf43ab187 Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Mon, 3 Mar 2014 01:18:53 +0100 Subject: [PATCH] Compare room number properly with null. Signed-off-by: Simon Eisenmann --- static/js/directives/chat.js | 2 +- static/js/directives/usability.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/directives/chat.js b/static/js/directives/chat.js index 72004311..97a81abe 100644 --- a/static/js/directives/chat.js +++ b/static/js/directives/chat.js @@ -319,7 +319,7 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], }; scope.$on("room", function(event, room) { - if (room) { + if (room !== null) { scope.showRoom(group_chat_id, {title: translation._("Group chat")}, {restore: true, minimized: true}); } else { scope.hideRoom(group_chat_id); diff --git a/static/js/directives/usability.js b/static/js/directives/usability.js index 930d5bee..5375f185 100644 --- a/static/js/directives/usability.js +++ b/static/js/directives/usability.js @@ -93,13 +93,13 @@ define(['jquery', 'underscore', 'text!partials/usability.html'], function($, _, }); $scope.$on("room", function(event, room) { - //console.log("roomStatus", status); + console.log("roomStatus", room !== null ? true : false); if (complete) { if (initializer !== null) { $timeout.cancel(initializer); initializer = null; } - ctrl.setInfo(room ? "room" : "noroom"); + ctrl.setInfo(room !== null ? "room" : "noroom"); } });