Merge pull request #3834 from matrix-org/dbkr/community-user-list-fire_rel

Repair community member info panel
This commit is contained in:
David Baker 2020-01-13 12:42:03 +00:00 committed by GitHub
commit 280253d58a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 11 deletions

View file

@ -21,14 +21,17 @@ import DMRoomMap from './utils/DMRoomMap';
module.exports = {
avatarUrlForMember: function(member, width, height, resizeMethod) {
let url = member.getAvatarUrl(
MatrixClientPeg.get().getHomeserverUrl(),
Math.floor(width * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio),
resizeMethod,
false,
false,
);
let url;
if (member && member.getAvatarUrl) {
url = member.getAvatarUrl(
MatrixClientPeg.get().getHomeserverUrl(),
Math.floor(width * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio),
resizeMethod,
false,
false,
);
}
if (!url) {
// member can be null here currently since on invites, the JS SDK
// does not have enough info to build a RoomMember object for

View file

@ -1299,7 +1299,7 @@ export default createReactClass({
);
}
const rightPanel = !RightPanelStore.getSharedInstance().isOpenForGroup
const rightPanel = RightPanelStore.getSharedInstance().isOpenForGroup
? <RightPanel groupId={this.props.groupId} />
: undefined;

View file

@ -55,7 +55,7 @@ module.exports = createReactClass({
},
_getState: function(props) {
if (props.member) {
if (props.member && props.member.name) {
return {
name: props.member.name,
title: props.title || props.member.userId,

View file

@ -74,7 +74,7 @@ export default class HeaderButtons extends React.Component {
const rps = RightPanelStore.getSharedInstance();
if (this.state.headerKind === HEADER_KIND_ROOM) {
this.setState({phase: rps.visibleRoomPanelPhase});
} else if (this.state.head === HEADER_KIND_GROUP) {
} else if (this.state.headerKind === HEADER_KIND_GROUP) {
this.setState({phase: rps.visibleGroupPanelPhase});
}
}