mirror of
https://github.com/jcreek/OpenNetworkDiagram.git
synced 2026-07-13 02:53:45 +00:00
fix(#5): avoid clobbering conflicting reciprocal port connections
This commit is contained in:
@@ -119,10 +119,21 @@ function ensureReciprocalConnections(data: NetworkData) {
|
||||
continue;
|
||||
}
|
||||
|
||||
targetPort.connectedTo = {
|
||||
const expectedReciprocal = {
|
||||
device: owner.name,
|
||||
port: port.portName
|
||||
};
|
||||
if (!targetPort.connectedTo) {
|
||||
targetPort.connectedTo = expectedReciprocal;
|
||||
continue;
|
||||
}
|
||||
|
||||
const hasMatchingReciprocal =
|
||||
equalsIgnoreCase(targetPort.connectedTo.device, owner.name) &&
|
||||
equalsIgnoreCase(targetPort.connectedTo.port, port.portName);
|
||||
if (hasMatchingReciprocal) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user