Skip to content

Commit 4c80ccf

Browse files
committed
delete unused fallback
1 parent 3b7d758 commit 4c80ccf

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

web/src/components/ImageFallback.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ type Props = {
99

1010
// https://medium.com/@abhishekmicosoft/handling-img-fallback-307653b2f30
1111
export function ImageFallback({ width, height, url, fallback }: Props) {
12-
const [ok, setOK] = useState<boolean>(true);
13-
useEffect(() => {
14-
url;
15-
setOK(true);
16-
}, [url]);
1712
const URL = url?.startsWith("/")
1813
? `${import.meta.env.VITE_API_ENDPOINT}${url}`
1914
: url;
2015

21-
return ok ? (
16+
return (
2217
<object
2318
data={URL}
2419
type="image/webp"
@@ -40,7 +35,5 @@ export function ImageFallback({ width, height, url, fallback }: Props) {
4035
alt=""
4136
/>
4237
</object>
43-
) : (
44-
<>{fallback}</>
4538
);
4639
}

0 commit comments

Comments
 (0)