perf: error show

This commit is contained in:
archer
2023-05-15 22:27:54 +08:00
parent e7d3a8e2e1
commit 371e0e36c6
10 changed files with 60 additions and 39 deletions

View File

@@ -45,6 +45,11 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
[modelDetail.userId, userInfo?._id]
);
const canRead = useMemo(
() => isOwner || isLoading || modelDetail.share.isShareDetail,
[isLoading, isOwner, modelDetail.share.isShareDetail]
);
/* 点击删除 */
const handleDelModel = useCallback(async () => {
if (!modelDetail) return;
@@ -129,7 +134,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
};
}, [router]);
return (
return canRead ? (
<Box h={'100%'} p={5} overflow={'overlay'} position={'relative'}>
{/* 头部 */}
<Card px={6} py={3}>
@@ -196,6 +201,10 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
</Grid>
<Loading loading={isLoading} fixed={false} />
</Box>
) : (
<Box h={'100%'} p={5}>
</Box>
);
};