mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
fix: 修复 ESC 键重复触发 handleNavigateBack 的问题
This commit is contained in:
parent
fe0ec8049c
commit
4df4681dc8
1 changed files with 6 additions and 8 deletions
|
|
@ -562,16 +562,14 @@ export const MCPManagementDialog: React.FC<MCPManagementDialogProps> = ({
|
|||
);
|
||||
}, [getCurrentStep, servers.length]);
|
||||
|
||||
// ESC键处理
|
||||
// ESC 键处理 - 仅关闭对话框,子组件的返回由各自处理避免重复触发
|
||||
useKeypress(
|
||||
(key) => {
|
||||
if (key.name === 'escape') {
|
||||
const currentStep = getCurrentStep();
|
||||
if (currentStep === MCP_MANAGEMENT_STEPS.SERVER_LIST) {
|
||||
onClose();
|
||||
} else {
|
||||
handleNavigateBack();
|
||||
}
|
||||
if (
|
||||
key.name === 'escape' &&
|
||||
getCurrentStep() === MCP_MANAGEMENT_STEPS.SERVER_LIST
|
||||
) {
|
||||
onClose();
|
||||
}
|
||||
},
|
||||
{ isActive: true },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue