fix: Fallback to initials instead of placeholder when offline
This commit is contained in:
@@ -2,7 +2,6 @@ import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import useBoolean from "~/hooks/useBoolean";
|
||||
import Initials from "./Initials";
|
||||
import placeholder from "./placeholder.png";
|
||||
|
||||
export interface IAvatar {
|
||||
avatarUrl: string | null;
|
||||
@@ -29,10 +28,10 @@ function Avatar(props: Props) {
|
||||
|
||||
return (
|
||||
<Relative>
|
||||
{src ? (
|
||||
{src && !error ? (
|
||||
<CircleImg
|
||||
onError={handleError}
|
||||
src={error ? placeholder : src}
|
||||
src={src}
|
||||
$showBorder={showBorder}
|
||||
{...rest}
|
||||
/>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 564 B |
Reference in New Issue
Block a user