fix(pending): drop dangling onNodeApproved call + add keydown deps

Single approve was calling a removed prop ref (caught by review).
Keydown effect now has explicit deps so it doesn't re-bind every render.
This commit is contained in:
Pouzor
2026-05-09 23:53:33 +02:00
parent 277879488f
commit b17299f531
@@ -258,7 +258,6 @@ export function PendingDevicesModal({ open, onClose, highlightId, initialStatus
toast.success(`Approved ${nodeData.label}${extra}`)
setDevices((prev) => prev.filter((d) => d.id !== device.id))
setSelected(null)
onNodeApproved(nodeId)
} catch {
toast.error('Failed to approve device')
}
@@ -352,7 +351,8 @@ export function PendingDevicesModal({ open, onClose, highlightId, initialStatus
}
window.addEventListener('keydown', handler)
return () => window.removeEventListener('keydown', handler)
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open, selectMode, selectedIds, filtered])
return (
<>