Tunnel detail: Account for status section in peer index calculations
This commit is contained in:
parent
373adc578c
commit
5cb2558fea
|
@ -103,9 +103,9 @@ extension TunnelDetailTableViewController {
|
||||||
return interfaceData.filterFieldsWithValueOrControl(interfaceFields: interfaceFieldsBySection[section - 1]).count
|
return interfaceData.filterFieldsWithValueOrControl(interfaceFields: interfaceFieldsBySection[section - 1]).count
|
||||||
} else if ((numberOfPeers > 0) && (section < (1 + numberOfInterfaceSections + numberOfPeers * numberOfPeerSections))) {
|
} else if ((numberOfPeers > 0) && (section < (1 + numberOfInterfaceSections + numberOfPeers * numberOfPeerSections))) {
|
||||||
// Peer
|
// Peer
|
||||||
let peerIndex = Int((section - numberOfInterfaceSections) / numberOfPeerSections)
|
let peerIndex = Int((section - 1 - numberOfInterfaceSections) / numberOfPeerSections)
|
||||||
let peerData = tunnelViewModel.peersData[peerIndex]
|
let peerData = tunnelViewModel.peersData[peerIndex]
|
||||||
let peerSectionIndex = (section - numberOfInterfaceSections) % numberOfPeerSections
|
let peerSectionIndex = (section - 1 - numberOfInterfaceSections) % numberOfPeerSections
|
||||||
return peerData.filterFieldsWithValueOrControl(peerFields: peerFieldsBySection[peerSectionIndex]).count
|
return peerData.filterFieldsWithValueOrControl(peerFields: peerFieldsBySection[peerSectionIndex]).count
|
||||||
} else {
|
} else {
|
||||||
// Delete tunnel
|
// Delete tunnel
|
||||||
|
|
Loading…
Reference in New Issue