From 2265d1a82af5b9d36ff2ccaf793c32596b3fca7f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 16 Mar 2016 22:25:57 +0000 Subject: [PATCH] fix display of null last_active_ago timestamps --- src/components/views/rooms/MemberTile.js | 5 ++--- src/components/views/rooms/UserTile.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/views/rooms/MemberTile.js b/src/components/views/rooms/MemberTile.js index d5c124ad21..89f4e35805 100644 --- a/src/components/views/rooms/MemberTile.js +++ b/src/components/views/rooms/MemberTile.js @@ -84,9 +84,8 @@ module.exports = React.createClass({ this.user_last_modified_time = member.user.getLastModifiedTime(); // FIXME: make presence data update whenever User.presence changes... - active = ( - (Date.now() - (member.user.lastPresenceTs - member.user.lastActiveAgo)) || -1 - ); + active = member.user.lastActiveAgo ? + (Date.now() - (member.user.lastPresenceTs - member.user.lastActiveAgo)) : -1; } this.member_last_modified_time = member.getLastModifiedTime(); diff --git a/src/components/views/rooms/UserTile.js b/src/components/views/rooms/UserTile.js index 6597796764..26b9df7e38 100644 --- a/src/components/views/rooms/UserTile.js +++ b/src/components/views/rooms/UserTile.js @@ -38,9 +38,8 @@ module.exports = React.createClass({ var active = -1; // FIXME: make presence data update whenever User.presence changes... - active = ( - (Date.now() - (user.lastPresenceTs - user.lastActiveAgo)) || -1 - ); + active = member.user.lastActiveAgo ? + (Date.now() - (member.user.lastPresenceTs - member.user.lastActiveAgo)) : -1; var BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); var avatarJsx = (