feat: 增强输入框状态管理,添加禁用状态和恢复输入状态的逻辑

This commit is contained in:
Roe-xin
2025-12-31 18:13:21 +08:00
parent 3d535fd3e1
commit 8762eacb3e
2 changed files with 28 additions and 0 deletions

View File

@ -96,6 +96,12 @@ export async function handleUserMessage(
text: "后端服务不可用",
type: "error",
});
// 恢复输入状态
panel.webview.postMessage({
command: "updateSegments",
segments: [],
isComplete: true,
});
throw error;
}
}
@ -255,6 +261,12 @@ async function handleUserMessageWithBackend(
command: "receiveMessage",
text: `❌ 错误: ${message}`,
});
// 恢复输入状态
panel.webview.postMessage({
command: "updateSegments",
segments: [],
isComplete: true,
});
reject(new Error(message));
},