保留分离结果的必要类型断言
TypeScript 对闭包赋值结果无法完成控制流收窄,恢复断言以通过类型检查。
This commit is contained in:
@@ -1194,7 +1194,7 @@ export function useUiEditorSession(
|
||||
}));
|
||||
if (separationResult === null)
|
||||
throw new Error('自动切分素材没有返回结果');
|
||||
const completedResult = separationResult;
|
||||
const completedResult = separationResult as SeparationDTO;
|
||||
if (!(await save({ allowDuringSeparation: true }))) {
|
||||
throw new Error(
|
||||
'自动切分素材结果已写入编辑器,但 State 保存失败;sidecar 已保留,可继续恢复。',
|
||||
|
||||
Reference in New Issue
Block a user