File tree 1 file changed +5
-2
lines changed
src/components/ui/link-card
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export const LinkCard = (props: LinkCardProps) => {
44
44
}
45
45
46
46
type CardState = {
47
- title : ReactNode
47
+ title ? : ReactNode
48
48
desc ?: ReactNode
49
49
image ?: string
50
50
color ?: string
@@ -431,6 +431,9 @@ const fetchTheMovieDBData: FetchObject = {
431
431
async fetch ( id , setCardInfo , setFullUrl ) {
432
432
const [ type , realId ] = id . split ( '/' )
433
433
434
+ setCardInfo ( {
435
+ classNames : { cardRoot : '!w-full' } ,
436
+ } )
434
437
const json = await fetch ( `/api/tmdb/${ type } /${ realId } ?language=zh-CN` )
435
438
. then ( ( r ) => r . json ( ) )
436
439
. catch ( ( err ) => {
@@ -472,6 +475,6 @@ const fetchTheMovieDBData: FetchObject = {
472
475
cardRoot : '!w-full' ,
473
476
} ,
474
477
} )
475
- setFullUrl ( json . homepage )
478
+ json . homepage && setFullUrl ( json . homepage )
476
479
} ,
477
480
}
You can’t perform that action at this time.
0 commit comments