refactor: 收口缺失创作状态回退
This commit is contained in:
@@ -540,7 +540,10 @@ import {
|
||||
buildPuzzleResultProfileId,
|
||||
buildPuzzleResultWorkId,
|
||||
} from './platformPuzzleIdentityModel';
|
||||
import { resolveSelectionStageAfterProtectedDataLoss } from './platformSelectionStageModel';
|
||||
import {
|
||||
resolveSelectionStageAfterMissingCreationState,
|
||||
resolveSelectionStageAfterProtectedDataLoss,
|
||||
} from './platformSelectionStageModel';
|
||||
import { PlatformTaskCompletionDialog } from './PlatformTaskCompletionDialog';
|
||||
import { PlatformWorkDetailView } from './PlatformWorkDetailView';
|
||||
import { usePlatformCreationAgentFlowController } from './usePlatformCreationAgentFlowController';
|
||||
@@ -8861,88 +8864,53 @@ export function PlatformEntryFlowShellImpl({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectionStage === 'big-fish-result' && !bigFishSession?.draft) {
|
||||
setSelectionStage(
|
||||
bigFishSession ? 'big-fish-agent-workspace' : 'platform',
|
||||
);
|
||||
}
|
||||
if (selectionStage === 'big-fish-runtime' && !bigFishRun) {
|
||||
setSelectionStage(bigFishSession?.draft ? 'big-fish-result' : 'platform');
|
||||
}
|
||||
}, [bigFishRun, bigFishSession, selectionStage, setSelectionStage]);
|
||||
const nextSelectionStage = resolveSelectionStageAfterMissingCreationState({
|
||||
stage: selectionStage,
|
||||
bigFish: {
|
||||
hasSession: Boolean(bigFishSession),
|
||||
hasSessionDraft: Boolean(bigFishSession?.draft),
|
||||
hasRun: Boolean(bigFishRun),
|
||||
},
|
||||
match3d: {
|
||||
hasSession: Boolean(match3dSession),
|
||||
hasSessionDraft: Boolean(match3dSession?.draft),
|
||||
hasRun: Boolean(match3dRun),
|
||||
},
|
||||
squareHole: {
|
||||
hasSession: Boolean(squareHoleSession),
|
||||
hasSessionDraft: Boolean(squareHoleSession?.draft),
|
||||
hasRun: Boolean(squareHoleRun),
|
||||
},
|
||||
visualNovel: {
|
||||
hasSession: Boolean(visualNovelSession),
|
||||
hasSessionDraft: Boolean(visualNovelSession?.draft),
|
||||
hasWork: Boolean(visualNovelWork),
|
||||
hasWorkDraft: Boolean(visualNovelWork?.draft),
|
||||
hasRun: Boolean(visualNovelRun),
|
||||
},
|
||||
babyObjectMatch: {
|
||||
hasDraft: Boolean(babyObjectMatchDraft),
|
||||
hasFormPayload: Boolean(babyObjectMatchFormPayload),
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (selectionStage === 'match3d-result' && !match3dSession?.draft) {
|
||||
setSelectionStage(
|
||||
match3dSession ? 'match3d-agent-workspace' : 'platform',
|
||||
);
|
||||
}
|
||||
if (selectionStage === 'match3d-runtime' && !match3dRun) {
|
||||
setSelectionStage(match3dSession?.draft ? 'match3d-result' : 'platform');
|
||||
}
|
||||
}, [match3dRun, match3dSession, selectionStage, setSelectionStage]);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectionStage === 'square-hole-result' && !squareHoleSession?.draft) {
|
||||
setSelectionStage(
|
||||
squareHoleSession ? 'square-hole-agent-workspace' : 'platform',
|
||||
);
|
||||
}
|
||||
if (selectionStage === 'square-hole-runtime' && !squareHoleRun) {
|
||||
setSelectionStage(
|
||||
squareHoleSession?.draft ? 'square-hole-result' : 'platform',
|
||||
);
|
||||
}
|
||||
}, [selectionStage, setSelectionStage, squareHoleRun, squareHoleSession]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
selectionStage === 'visual-novel-result' &&
|
||||
!visualNovelSession?.draft &&
|
||||
!visualNovelWork?.draft
|
||||
) {
|
||||
setSelectionStage(
|
||||
visualNovelSession ? 'visual-novel-agent-workspace' : 'platform',
|
||||
);
|
||||
}
|
||||
if (selectionStage === 'visual-novel-runtime' && !visualNovelRun) {
|
||||
setSelectionStage(
|
||||
visualNovelSession?.draft || visualNovelWork?.draft
|
||||
? 'visual-novel-result'
|
||||
: 'platform',
|
||||
);
|
||||
}
|
||||
if (selectionStage === 'visual-novel-gallery-detail' && !visualNovelWork) {
|
||||
setSelectionStage('platform');
|
||||
}
|
||||
}, [
|
||||
selectionStage,
|
||||
setSelectionStage,
|
||||
visualNovelRun,
|
||||
visualNovelSession,
|
||||
visualNovelWork,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
selectionStage === 'baby-object-match-result' &&
|
||||
!babyObjectMatchDraft
|
||||
) {
|
||||
setSelectionStage(
|
||||
babyObjectMatchFormPayload ? 'baby-object-match-workspace' : 'platform',
|
||||
);
|
||||
}
|
||||
if (
|
||||
selectionStage === 'baby-object-match-runtime' &&
|
||||
!babyObjectMatchDraft
|
||||
) {
|
||||
setSelectionStage('platform');
|
||||
if (nextSelectionStage !== selectionStage) {
|
||||
setSelectionStage(nextSelectionStage);
|
||||
}
|
||||
}, [
|
||||
babyObjectMatchDraft,
|
||||
babyObjectMatchFormPayload,
|
||||
bigFishRun,
|
||||
bigFishSession,
|
||||
match3dRun,
|
||||
match3dSession,
|
||||
selectionStage,
|
||||
setSelectionStage,
|
||||
squareHoleRun,
|
||||
squareHoleSession,
|
||||
visualNovelRun,
|
||||
visualNovelSession,
|
||||
visualNovelWork,
|
||||
]);
|
||||
|
||||
const startBigFishRun = useCallback(async () => {
|
||||
|
||||
Reference in New Issue
Block a user