Fix blank avatar on Safari

This commit is contained in:
J. Ryan Stinnett 2020-09-29 16:10:44 +01:00
parent dcc43ff436
commit 684a4cb19a

View file

@ -35,7 +35,7 @@ interface IProps {
const Avatar: React.FC<IProps> = ({ className, avatarUrl, label }: IProps) => { const Avatar: React.FC<IProps> = ({ className, avatarUrl, label }: IProps) => {
const [src, setSrc] = useState(avatarUrl); const [src, setSrc] = useState(avatarUrl);
useEffect(() => { useEffect(() => {
setSrc(avatarUrl); setSrc(avatarUrl ? avatarUrl : logo);
}, [avatarUrl]); }, [avatarUrl]);
const _className = classNames('avatar', className, { const _className = classNames('avatar', className, {