fix: 自由创作分类入库区分视频与图片展示

This commit is contained in:
hh
2026-07-07 18:39:01 +08:00
parent 45ff7838d8
commit ff723b4281
7 changed files with 228 additions and 22 deletions
+5 -1
View File
@@ -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; };
}, []);