From cb86ab8be98bf669f4cc10dec54c621df90d32b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 3 Sep 2026 13:15:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=BF=AB=E7=85=A7=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交历史时复用已克隆的 nextState,避免每次编辑产生冗余深拷贝 --- .../src/features/ui-editor/useUiEditorState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/useUiEditorState.ts b/apps/ai-game-creator-shell/src/features/ui-editor/useUiEditorState.ts index 2ef8569e5..6b14446ec 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/useUiEditorState.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/useUiEditorState.ts @@ -567,7 +567,7 @@ export function useUiEditorState(initialState: State = EMPTY_UI_EDITOR_STATE) { if (sameResource(current, nextState)) return false; undoStackRef.current.push({ before: cloneState(current), - after: cloneState(nextState), + after: nextState, }); if (undoStackRef.current.length > MAX_HISTORY_LENGTH) { undoStackRef.current.shift();