Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync release 0.4.10 to dev #2566

Merged
merged 13 commits into from
Apr 2, 2024
Prev Previous commit
Next Next commit
fix: should not show broken image (#2526)
  • Loading branch information
louis-jan committed Mar 28, 2024
commit 6e01e04c76d212a9100f5199494ccb664c7d6194
8 changes: 5 additions & 3 deletions web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback } from 'react'
import { useCallback, useState } from 'react'

import { Model } from '@janhq/core'
import {
Expand Down Expand Up @@ -70,6 +70,7 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
const { requestCreateNewThread } = useCreateNewThread()
const totalRam = useAtomValue(totalRamAtom)
const { settings } = useSettings()
const [imageLoaded, setImageLoaded] = useState(true)

const nvidiaTotalVram = useAtomValue(nvidiaTotalVramAtom)
const setMainViewState = useSetAtom(mainViewStateAtom)
Expand Down Expand Up @@ -143,9 +144,10 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
className="cursor-pointer rounded-t-md bg-background"
onClick={onClick}
>
{model.metadata.cover && (
<div className="relative h-full w-full ">
{model.metadata.cover && imageLoaded && (
<div className="relative h-full w-full">
<img
onError={() => setImageLoaded(false)}
src={model.metadata.cover}
className="h-[250px] w-full object-cover"
alt={`Cover - ${model.id}`}
Expand Down
Loading