From a62c260f794f2f89815045458b05a656bc5962dc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 7 Jan 2020 12:58:24 +0000 Subject: [PATCH] Fix userinfo for users not in the room Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/right_panel/UserInfo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index b55991eda8..9c90953114 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -1000,8 +1000,8 @@ const UserInfo = ({user, groupId, roomId, onClose}) => { // Load room if we are given a room id and memoize it const room = useMemo(() => roomId ? cli.getRoom(roomId) : null, [cli, roomId]); - // fetch latest room member if we have a room, so we don't show historical information - const member = useMemo(() => room ? room.getMember(user.userId) : user, [room, user]); + // fetch latest room member if we have a room, so we don't show historical information, falling back to user + const member = useMemo(() => room ? (room.getMember(user.userId) || user) : user, [room, user]); // only display the devices list if our client supports E2E const _enableDevices = cli.isCryptoEnabled();