fix: reset tool name mappings in handleCancel and handleCreate

Addresses Greptile feedback: toolNameToDisplayName and toolNameToDescription
were not being reset when the modal was cancelled or after successful creation,
which could leak stale data from a duplicated server into the next fresh
create modal.

https://claude.ai/code/session_01Wx49QQnsCngnJ7hsfaC1yC
This commit is contained in:
mateo-berri 2026-06-06 22:12:09 +00:00
parent f0578f7124
commit 7c23282da7
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View file

@ -1517,11 +1517,6 @@
"count": 1
}
},
"src/components/organisms/RegenerateKeyModal.tsx": {
"react-hooks/set-state-in-effect": {
"count": 1
}
},
"src/components/organisms/create_key_button.test.tsx": {
"@typescript-eslint/no-require-imports": {
"count": 2

View file

@ -569,6 +569,8 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
setHasToolAllowlistInteraction(false);
setAliasManuallyEdited(false);
setLogoUrl(undefined);
setToolNameToDisplayName({});
setToolNameToDescription({});
setModalVisible(false);
onCreateSuccess(response);
}
@ -591,6 +593,8 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
setHasToolAllowlistInteraction(false);
setAliasManuallyEdited(false);
setLogoUrl(undefined);
setToolNameToDisplayName({});
setToolNameToDescription({});
setModalVisible(false);
};