|
|
@ -267,24 +267,29 @@ const AnNetworkConfigInputGroup = < |
|
|
|
|
|
|
|
|
|
|
|
const handleNetworkRemove = useCallback<AnNetworkCloseEventHandler>( |
|
|
|
const handleNetworkRemove = useCallback<AnNetworkCloseEventHandler>( |
|
|
|
({ networkId: rmId, networkType: rmType }) => { |
|
|
|
({ networkId: rmId, networkType: rmType }) => { |
|
|
|
let isIdMatch = false; |
|
|
|
let postMatch = false; |
|
|
|
let networkNumber = 0; |
|
|
|
let networkNumber = 0; |
|
|
|
|
|
|
|
|
|
|
|
const newList = networkListEntries.reduce<ManifestNetworkList>( |
|
|
|
const newList = networkListEntries.reduce<ManifestNetworkList>( |
|
|
|
(previous, [networkId, networkValue]) => { |
|
|
|
(previous, [networkId, networkValue]) => { |
|
|
|
if (networkId === rmId) { |
|
|
|
if (networkId === rmId) { |
|
|
|
isIdMatch = true; |
|
|
|
postMatch = true; |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
return previous; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { networkType } = networkValue; |
|
|
|
const { networkType } = networkValue; |
|
|
|
|
|
|
|
|
|
|
|
if (networkType === rmType) { |
|
|
|
const change = networkType === rmType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (change) { |
|
|
|
networkNumber += 1; |
|
|
|
networkNumber += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
previous[networkId] = isIdMatch |
|
|
|
previous[networkId] = |
|
|
|
|
|
|
|
postMatch && change |
|
|
|
? { ...networkValue, networkNumber } |
|
|
|
? { ...networkValue, networkNumber } |
|
|
|
: networkValue; |
|
|
|
: networkValue; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return previous; |
|
|
|
return previous; |
|
|
|
}, |
|
|
|
}, |
|
|
|