Merge pull request #3812 from matrix-org/t3chguy/fix_UserInfo

Fix userinfo for users not in the room
This commit is contained in:
Michael Telatynski 2020-01-07 16:50:10 +00:00 committed by GitHub
commit 87a6791eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();