refresh avatar for closed group on new props

pull/1336/head
Audric Ackermann 5 years ago
parent afb1296c3d
commit bc1aff747a
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -111,15 +111,11 @@ export class Avatar extends React.PureComponent<Props, State> {
/> />
); );
} }
console.warn(
return ( 'renderNoImage should not happen with something else than a closed group'
<div
className={classNames(
'module-avatar__icon',
`module-avatar__icon--${conversationType}`
)}
/>
); );
return <div className={classNames('module-avatar__icon')} />;
} }
public render() { public render() {

@ -20,6 +20,10 @@ export function usingClosedConversationDetails(WrappedComponent: any) {
void this.fetchClosedConversationDetails(); void this.fetchClosedConversationDetails();
} }
public componentDidUpdate() {
void this.fetchClosedConversationDetails();
}
public render() { public render() {
return ( return (
<WrappedComponent <WrappedComponent
@ -42,7 +46,6 @@ export function usingClosedConversationDetails(WrappedComponent: any) {
!isPublic && !isPublic &&
(conversationType === 'group' || type === 'group' || isGroup) (conversationType === 'group' || type === 'group' || isGroup)
) { ) {
console.warn('fetchClosedConversationDetails');
const groupId = id || phoneNumber; const groupId = id || phoneNumber;
let members = await GroupUtils.getGroupMembers(PubKey.cast(groupId)); let members = await GroupUtils.getGroupMembers(PubKey.cast(groupId));
const ourPrimary = await UserUtil.getPrimary(); const ourPrimary = await UserUtil.getPrimary();

Loading…
Cancel
Save