From 095ba3d85c70cbe2574280d581f8df985fe86944 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 23 Dec 2025 12:11:08 +0000 Subject: [PATCH] Polish: Fix agent command generation logic in NodeModal --- .../src/components/Settings/NodeModal.tsx | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/frontend-modern/src/components/Settings/NodeModal.tsx b/frontend-modern/src/components/Settings/NodeModal.tsx index 29dabb563..6dff6a107 100644 --- a/frontend-modern/src/components/Settings/NodeModal.tsx +++ b/frontend-modern/src/components/Settings/NodeModal.tsx @@ -4,6 +4,7 @@ import type { NodeConfig } from '@/types/nodes'; import type { SecurityStatus } from '@/types/config'; import { copyToClipboard } from '@/utils/clipboard'; import { showSuccess, showError } from '@/utils/toast'; +import { notificationStore } from '@/stores/notifications'; import { getPulseBaseUrl } from '@/utils/url'; import { NodesAPI } from '@/api/nodes'; import { SectionHeader } from '@/components/shared/SectionHeader'; @@ -796,19 +797,15 @@ export const NodeModal: Component = (props) => { enableProxmox: true, }); - if (response.ok) { - const data = await response.json(); - if (data.command) { - setAgentInstallCommand(data.command); - const copied = await copyToClipboard(data.command); - if (copied) { - showSuccess('Command copied! Run it on your Proxmox node.'); - } else { - showError('Failed to copy to clipboard'); - } + + if (data.command) { + setAgentInstallCommand(data.command); + const copied = await copyToClipboard(data.command); + if (copied) { + notificationStore.success('Command copied! Run it on your Proxmox node.'); + } else { + notificationStore.error('Failed to copy to clipboard'); } - } else { - showError('Failed to generate install command'); } } catch (error) { logger.error('[Agent Install] Error:', error);