Fix selectedIndexPath with generic section indexes

This commit is contained in:
Davide De Rosa 2019-04-10 16:49:32 +02:00
parent 489229b1eb
commit ff8d57e9f0
1 changed files with 2 additions and 2 deletions

View File

@ -362,12 +362,12 @@ extension OrganizerViewController {
switch active.context {
case .provider:
if let row = providers.index(where: { $0 == active.id }) {
return IndexPath(row: row, section: 0)
return IndexPath(row: row, section: model.index(ofSection: .providers))
}
case .host:
if let row = hosts.index(where: { $0 == active.id }) {
return IndexPath(row: row, section: 1)
return IndexPath(row: row, section: model.index(ofSection: .hosts))
}
}
return nil