fix: 自由创作分类入库区分视频与图片展示
This commit is contained in:
@@ -51,7 +51,11 @@ export function Dashboard({ products, projects, productTotal, projectTotal, bill
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
api.assetSummary()
|
||||
.then((c) => { if (alive) setAssetCount(Object.values(c).reduce((a, b) => a + b, 0)); })
|
||||
.then((c) => {
|
||||
if (!alive) return;
|
||||
const imageCreations = c.image_creations ?? c.creations ?? 0;
|
||||
setAssetCount((c.tryon || 0) + (c.kits || 0) + imageCreations + (c.video_creations || 0) + (c.others || 0));
|
||||
})
|
||||
.catch(() => {});
|
||||
return () => { alive = false; };
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user