Skip to content

Commit

Permalink
update icon rul
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Sep 26, 2024
1 parent a520cc0 commit db5cb8e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/ChannelItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const Tilt = (props) => {
const ChannelItem = ({ channelProp }, delay) => {
const [channelObject, setChannelObject] = React.useState({});
const [loading, setLoading] = React.useState(true);
const imageBaseUrl = 'https://backend.epns.io';

React.useEffect(() => {
if (!channelProp) return;
Expand All @@ -95,7 +96,13 @@ const ChannelItem = ({ channelProp }, delay) => {
<ChannelLogo>
{loading && <Skeleton height={100} width={100} borderRadius={20} />}
{!loading && channelObject.icon && (
<ChannelLogoImg src={`${channelObject.icon}`} />
<ChannelLogoImg
src={
channelObject.icon.startsWith(imageBaseUrl)
? channelObject.icon
: `${imageBaseUrl}/apis/v1/channels/icon/${channelObject.channel}`
}
/>
)}
{!loading && channelObject.imageFile && (
<MemberImage
Expand Down

0 comments on commit db5cb8e

Please sign in to comment.