Skip to content

Commit

Permalink
Replaced React image with Chackra image to fix server error
Browse files Browse the repository at this point in the history
Checking for a nonexistent image externally on the server side makes no sense, so we use the Chackra Image which pulls on client-side
thereby preventing those image not found server errors. Also you can specify an alternate image, if the image is not found anymore, which is
set to the default battle.net image. We should avoid using the react image, since I think it is meant for self-hosted images.

Signed-off-by: Benedek Major <benedek@major.onl>
  • Loading branch information
Bensikrac committed Jul 25, 2023
1 parent 6226a75 commit 37bef2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/web/pages/submissions/review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
useToast,
Spinner,
Tag,
Image as Img,
} from '@chakra-ui/react';
import { useState, useEffect, ReactElement } from 'react';
import { useRouter } from 'next/router';
Expand All @@ -17,7 +18,6 @@ import { prisma } from '@server/db/client';
import TurnstileWidget from '@components/TurnstileWidget';
import Finished from '@components/Finished';
import { getSession } from 'next-auth/react';
import Image from 'next/image';
import { games } from '@config/gameplay';
import { GameplayType } from '@utils/zod/gameplay';
interface ReviewItem {
Expand Down Expand Up @@ -193,7 +193,7 @@ export default function Review() {
<Flex direction={'row'}>
{/* User Icon */}
<Box>
<Image
<Img
src={
reviewItem != null &&
reviewItem.user != null &&
Expand All @@ -206,6 +206,7 @@ export default function Review() {
height={54}
style={{ borderRadius: '100%' }}
onClick={() => setRefreshState(refreshState + 1)}
fallbackSrc="https://waldo.vision/battle_net.png"
/>
</Box>
{/* Top titles */}
Expand Down

0 comments on commit 37bef2a

Please sign in to comment.