From e14061a0fe7586ae62765c5e8861273d961edd0f Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Thu, 28 May 2026 00:49:27 +0800 Subject: [PATCH] fix: refresh wooden fish draft shelf after generation --- .../PlatformEntryFlowShellImpl.tsx | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx index 48a1278cc..a548a1427 100644 --- a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx +++ b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx @@ -2094,6 +2094,8 @@ function buildDraftCompletionDialogSource( return formatPlatformTaskCompletionSource('方洞挑战草稿', sourceId); case 'jump-hop': return formatPlatformTaskCompletionSource('跳一跳草稿', sourceId); + case 'wooden-fish': + return formatPlatformTaskCompletionSource('敲木鱼草稿', sourceId); case 'puzzle': return formatPlatformTaskCompletionSource('拼图草稿', sourceId); case 'visual-novel': @@ -8886,6 +8888,8 @@ export function PlatformEntryFlowShellImpl({ setWoodenFishGenerationState(generationState); setIsWoodenFishBusy(true); setSelectionStage('wooden-fish-generating'); + markDraftGenerating('wooden-fish', [created.session.sessionId]); + markPendingDraftGenerating('wooden-fish', created.session.sessionId); try { const response = await woodenFishClient.executeAction( @@ -8920,6 +8924,30 @@ export function PlatformEntryFlowShellImpl({ setWoodenFishGenerationState( createReadyWoodenFishGenerationState(generationState), ); + if (response.work) { + setWoodenFishWorks((current) => [ + response.work!.summary, + ...current.filter( + (item) => item.workId !== response.work!.summary.workId, + ), + ]); + markPendingDraftReady( + 'wooden-fish', + created.session.sessionId, + false, + ); + markDraftReady( + 'wooden-fish', + [ + created.session.sessionId, + response.work.summary.workId, + response.work.summary.profileId, + response.work.summary.sourceSessionId, + ], + false, + ); + void refreshWoodenFishShelf().catch(() => undefined); + } setSelectionStage('wooden-fish-result'); } catch (error) { const errorMessage = resolveRpgCreationErrorMessage( @@ -8954,7 +8982,15 @@ export function PlatformEntryFlowShellImpl({ setIsWoodenFishBusy(false); } }, - [createReadyWoodenFishGenerationState, setSelectionStage], + [ + createReadyWoodenFishGenerationState, + markDraftGenerating, + markDraftReady, + markPendingDraftGenerating, + markPendingDraftReady, + refreshWoodenFishShelf, + setSelectionStage, + ], ); const retryWoodenFishDraftGeneration = useCallback(() => {