fix: stop showing failed bark battle drafts as generating
This commit is contained in:
@@ -1048,7 +1048,7 @@ test('buildCreationWorkShelfItems maps bark battle works with scene role cover a
|
||||
);
|
||||
});
|
||||
|
||||
test('bark battle draft generating state follows pending assets or missing three images', () => {
|
||||
test('bark battle draft generating state only follows pending assets', () => {
|
||||
const draft = {
|
||||
workId: 'bark-battle-work-draft',
|
||||
draftId: 'bark-battle-draft-1',
|
||||
@@ -1073,6 +1073,12 @@ test('bark battle draft generating state follows pending assets or missing three
|
||||
|
||||
expect(hasBarkBattleRequiredImages(draft)).toBe(false);
|
||||
expect(isPersistedBarkBattleDraftGenerating(draft)).toBe(true);
|
||||
expect(
|
||||
isPersistedBarkBattleDraftGenerating({
|
||||
...draft,
|
||||
generationStatus: 'partial_failed',
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isPersistedBarkBattleDraftGenerating({
|
||||
...draft,
|
||||
|
||||
@@ -1111,10 +1111,9 @@ export function isPersistedBarkBattleDraftGenerating(
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
item.generationStatus === 'pending_assets' ||
|
||||
!hasBarkBattleRequiredImages(item)
|
||||
);
|
||||
// 中文注释:汪汪声浪生成失败后会回写 partial_failed 并进入结果页承接错误槽位,
|
||||
// 不能因为三图未齐就继续把作品架整卡锁成“生成中”。
|
||||
return item.generationStatus === 'pending_assets';
|
||||
}
|
||||
|
||||
export function hasBarkBattleRequiredImages(item: BarkBattleWorkSummary) {
|
||||
|
||||
Reference in New Issue
Block a user