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

Commit

Permalink
added useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
coltoneshaw committed Feb 6, 2023
1 parent 0f76356 commit 5651d09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/channel_members_rhs/member.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import React from 'react';
import React, {useEffect} from 'react';
import styled from 'styled-components';
import classNames from 'classnames';
import {FormattedMessage} from 'react-intl';
Expand Down Expand Up @@ -110,7 +110,13 @@ interface MMOverlayTrigger extends BaseOverlayTrigger {

const Member = ({className, channel, member, index, totalUsers, editing, actions}: Props) => {
const overlay = React.createRef<MMOverlayTrigger>();
const profileSrc = Client4.getProfilePictureUrl(member.user.id, member.user.last_picture_update);

const [profileSrc, setProfileSrc] = React.useState<string>('');
useEffect(() => {
setProfileSrc(
Client4.getProfilePictureUrl(member.user.id, member.user.last_picture_update),
);
}, [member.user.id, member.user.last_picture_update]);

const hideProfilePopover = () => {
if (overlay.current) {
Expand Down

0 comments on commit 5651d09

Please sign in to comment.