fix: manual node setup 'Node ID Required' error

Fixed issue where discovered nodes and manual node setup would incorrectly
call updateNode instead of addNode. The problem was that discovered nodes
were set with an empty string ID, which made the code think it was editing
an existing node.

Now properly checks for both editingNode existence AND a valid ID before
deciding whether to update or add.

Fixes #289
This commit is contained in:
Pulse Monitor
2025-08-10 20:02:28 +00:00
parent 1414779609
commit 55e0190777
@@ -1727,8 +1727,8 @@ docker run -d \
editingNode={editingNode() ?? undefined}
onSave={async (nodeData) => {
try {
if (editingNode()) {
// Update existing node
if (editingNode() && editingNode()!.id) {
// Update existing node (only if it has a valid ID)
await NodesAPI.updateNode(editingNode()!.id, nodeData as NodeConfig);
// Update local state