允许分离流程在忙碌态保存结果
保留 isSeparating 属于 isAiRunning 的全局语义 为内部分离保存增加受控 allowDuringSeparation 选项
This commit is contained in:
@@ -1196,7 +1196,7 @@ export function useUiEditorSession(
|
||||
if (separationResult === null)
|
||||
throw new Error('自动切分素材没有返回结果');
|
||||
const completedResult = separationResult as SeparationDTO;
|
||||
if (!(await save())) {
|
||||
if (!(await save({ allowDuringSeparation: true }))) {
|
||||
throw new Error(
|
||||
'自动切分素材结果已写入编辑器,但 State 保存失败;sidecar 已保留,可继续恢复。',
|
||||
);
|
||||
@@ -1342,13 +1342,19 @@ export function useUiEditorSession(
|
||||
}
|
||||
}
|
||||
|
||||
async function save() {
|
||||
async function save(options?: { allowDuringSeparation?: boolean }) {
|
||||
const allowDuringSeparation =
|
||||
options?.allowDuringSeparation === true &&
|
||||
isSeparating &&
|
||||
!isSuggesting &&
|
||||
!isRecognizing &&
|
||||
!isMerging;
|
||||
if (
|
||||
!resourceId ||
|
||||
isSaving ||
|
||||
isGenerating ||
|
||||
isLoading ||
|
||||
isAiRunning ||
|
||||
(isAiRunning && !allowDuringSeparation) ||
|
||||
loadError ||
|
||||
persistedRevision === null ||
|
||||
editor.isLocked
|
||||
|
||||
Reference in New Issue
Block a user