Enhance MCP settings export with error handling and null value removal (#465)

This commit is contained in:
samanhappy
2025-12-01 16:28:45 +08:00
committed by GitHub
parent 764959eaca
commit 9d8f5ba370
3 changed files with 137 additions and 81 deletions

View File

@@ -106,6 +106,10 @@ const ServerCard = ({ server, onRemove, onEdit, onToggle, onRefresh }: ServerCar
e.stopPropagation();
try {
const result = await exportMCPSettings(server.name);
if (!result || !result.success || !result.data) {
showToast(result?.message || t('common.copyFailed') || 'Copy failed', 'error');
return;
}
const configJson = JSON.stringify(result.data, null, 2);
if (navigator.clipboard && window.isSecureContext) {