1
This commit is contained in:
@@ -1272,16 +1272,17 @@ export function PlatformEntryFlowShellImpl({
|
||||
setDeletingCreationWorkId(work.workId);
|
||||
platformBootstrap.setPlatformError(null);
|
||||
|
||||
const deleteTask = work.profileId
|
||||
? deleteRpgEntryWorldProfile(work.profileId).then(async (entries) => {
|
||||
platformBootstrap.setSavedCustomWorldEntries(entries);
|
||||
await platformBootstrap.refreshCustomWorldWorks().catch(() => []);
|
||||
})
|
||||
: work.sessionId
|
||||
? deleteRpgCreationAgentSession(work.sessionId).then((items) => {
|
||||
platformBootstrap.setCustomWorldWorkEntries(items);
|
||||
const deleteTask =
|
||||
work.sourceType === 'published_profile' && work.profileId
|
||||
? deleteRpgEntryWorldProfile(work.profileId).then(async (entries) => {
|
||||
platformBootstrap.setSavedCustomWorldEntries(entries);
|
||||
await platformBootstrap.refreshCustomWorldWorks().catch(() => []);
|
||||
})
|
||||
: Promise.reject(new Error('当前 RPG 作品缺少可删除 ID。'));
|
||||
: work.sourceType === 'agent_session' && work.sessionId
|
||||
? deleteRpgCreationAgentSession(work.sessionId).then((items) => {
|
||||
platformBootstrap.setCustomWorldWorkEntries(items);
|
||||
})
|
||||
: Promise.reject(new Error('当前 RPG 作品缺少可删除 ID。'));
|
||||
|
||||
void deleteTask
|
||||
.then(async () => {
|
||||
@@ -2087,23 +2088,43 @@ export function PlatformEntryFlowShellImpl({
|
||||
});
|
||||
});
|
||||
}}
|
||||
onTestWorld={() => {
|
||||
runProtectedAction(() => {
|
||||
void enterWorldCoordinator
|
||||
.enterWorldForTestFromCurrentResult()
|
||||
.catch((error) => {
|
||||
sessionController.setCustomWorldError(
|
||||
resolveRpgCreationErrorMessage(
|
||||
error,
|
||||
'进入作品测试失败。',
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}}
|
||||
onPublishWorld={async () => {
|
||||
await enterWorldCoordinator.publishCurrentResult();
|
||||
}}
|
||||
onTestWorld={
|
||||
sessionController.isAgentDraftResultView &&
|
||||
sessionController.agentSession?.stage !== 'published'
|
||||
? () => {
|
||||
runProtectedAction(() => {
|
||||
void enterWorldCoordinator
|
||||
.enterWorldForTestFromCurrentResult()
|
||||
.catch((error) => {
|
||||
sessionController.setCustomWorldError(
|
||||
resolveRpgCreationErrorMessage(
|
||||
error,
|
||||
'进入作品测试失败。',
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
onPublishWorld={
|
||||
sessionController.isAgentDraftResultView &&
|
||||
sessionController.agentSession?.stage !== 'published'
|
||||
? async () => {
|
||||
try {
|
||||
await enterWorldCoordinator.publishCurrentResult();
|
||||
} catch (error) {
|
||||
sessionController.setCustomWorldError(
|
||||
resolveRpgCreationErrorMessage(
|
||||
error,
|
||||
'发布到广场失败。',
|
||||
),
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
onGenerateEntity={
|
||||
sessionController.isAgentDraftResultView
|
||||
? async (kind) => {
|
||||
|
||||
Reference in New Issue
Block a user