mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-23 18:29:21 -05:00
Enhance MCP settings export with error handling and null value removal (#465)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user