Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix initial in GroupAvatar in GroupView #1553

Merged
merged 1 commit into from
Oct 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/structures/GroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ export default React.createClass({
} else {
const GroupAvatar = sdk.getComponent('avatars.GroupAvatar');
avatarImage = <GroupAvatar groupId={this.props.groupId}
groupName={this.state.profileForm.name}
groupAvatarUrl={this.state.profileForm.avatar_url}
width={48} height={48} resizeMethod='crop'
/>;
Expand Down Expand Up @@ -928,9 +929,11 @@ export default React.createClass({
dir="auto" />;
} else {
const groupAvatarUrl = summary.profile ? summary.profile.avatar_url : null;
const groupName = summary.profile ? summary.profile.name : null;
avatarNode = <GroupAvatar
groupId={this.props.groupId}
groupAvatarUrl={groupAvatarUrl}
groupName={groupName}
onClick={this._onEditClick}
width={48} height={48}
/>;
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/avatars/GroupAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default React.createClass({

propTypes: {
groupId: PropTypes.string,
groupName: PropTypes.string,
groupAvatarUrl: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number,
Expand Down Expand Up @@ -57,7 +58,7 @@ export default React.createClass({

return (
<BaseAvatar
name={this.props.groupId[1]}
name={this.props.groupName || this.props.groupId[1]}
idName={this.props.groupId}
url={this.getGroupAvatarUrl()}
{...otherProps}
Expand Down