diff --git a/app/space/[id]/page.js b/app/space/[id]/page.js index 8e670f2..9283ece 100644 --- a/app/space/[id]/page.js +++ b/app/space/[id]/page.js @@ -62,7 +62,7 @@ export default function PersonSpace() { // debugger } getStreamerInfo(Number(id)).then((res) => { - let tabitems = res.is_superfanship_enabled + let tabitems = res?.is_superfanship_enabled ? [ { label: "全部", key: "all" }, { label: "铁粉专享", key: "ironFan" }, diff --git a/components/PostItem/index.js b/components/PostItem/index.js index 6ac7623..7c6059d 100644 --- a/components/PostItem/index.js +++ b/components/PostItem/index.js @@ -25,11 +25,15 @@ export default function PostItem({ const [isThumbsUp, setIsThumbsUp] = useState( data?.is_thumbed_up || data?.is_zone_moment_thumbed_up ); + const [account, setAccount] = useState( + data?.is_thumbed_up || data?.is_zone_moment_thumbed_up + ); //判断是否是发帖人 const [isCreator, setIsCreator] = useState(false); useEffect(() => { - const account = get("account"); - if (account?.mid === data.mid) setIsCreator(true); + const currentAccount = get("account"); + setAccount(currentAccount); + if (currentAccount?.mid === data.mid) setIsCreator(true); return () => { router.prefetch("/profile/" + data.mid); }; @@ -370,7 +374,7 @@ export default function PostItem({ style={{ "--background": "#1E1C29" }} content={