fix: 自由创作完成后同步余额通知
This commit is contained in:
@@ -218,6 +218,13 @@ export function App() {
|
||||
if (data) setUnreadCount(data.unread_count);
|
||||
}, []);
|
||||
|
||||
// 自由创作自行管理长视频轮询;任务终态后只需同步顶栏依赖的两项全局数据,
|
||||
// 不必像通用 action 一样重拉商品、项目和素材列表。
|
||||
const refreshFreeCreateShell = useCallback(() => {
|
||||
void api.billingSummary().then((summary) => setBilling(summary)).catch(() => {});
|
||||
void reloadNotifications();
|
||||
}, [reloadNotifications]);
|
||||
|
||||
// YYX#row22:拉未读生成任务汇总(导航胶囊 + 商品角标)
|
||||
const reloadAiUnread = useCallback(async () => {
|
||||
const data = await api.aiTasksUnread().catch(() => null);
|
||||
@@ -925,7 +932,7 @@ export function App() {
|
||||
case "assetFactory":
|
||||
return <AssetFactoryPage navigate={navigate} />;
|
||||
case "freeCreate":
|
||||
return <FreeCreatePage modelConfigs={modelConfigs} onNotify={(type, text) => setNotice({ type, text })} />;
|
||||
return <FreeCreatePage modelConfigs={modelConfigs} onNotify={(type, text) => setNotice({ type, text })} onTaskSettled={refreshFreeCreateShell} />;
|
||||
case "imageOptimize":
|
||||
return <ImageWorkbenchPage mode="image" products={products} modelConfigs={modelConfigs} initialProductId={activeProductId} onProductChange={setActiveProductId} unreadByProduct={aiUnreadByProduct} onProductViewed={markAiRead} onBack={() => navigate("assetFactory")} navigate={navigate} onGenerate={generateImages} onResume={resumeImages} />;
|
||||
case "modelPhoto":
|
||||
|
||||
Reference in New Issue
Block a user