Fix selected option for compression fields

This commit is contained in:
Davide De Rosa 2019-05-04 10:33:04 +02:00
parent d44e9f861b
commit aff371d500
1 changed files with 3 additions and 8 deletions

View File

@ -264,12 +264,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
} else {
cell.rightText = L10n.Global.Cells.disabled
}
if configuration.compressionFraming != .disabled {
cell.isTappable = true
} else {
cell.accessoryType = .none
cell.isTappable = false
}
cell.isTappable = (configuration.compressionFraming != .disabled)
case .resetOriginal:
cell.leftText = L10n.Configuration.Cells.ResetOriginal.caption
@ -405,7 +400,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
let vc = OptionViewController<SessionProxy.CompressionFraming>()
vc.title = settingCell?.leftText
vc.options = [.disabled, .compLZO, .compress]
vc.selectedOption = configuration.compressionFraming
vc.selectedOption = configuration.compressionFraming ?? .disabled
vc.descriptionBlock = { $0.cellDescription }
vc.selectionBlock = { [weak self] in
self?.configuration.compressionFraming = $0
@ -424,7 +419,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
let vc = OptionViewController<SessionProxy.CompressionAlgorithm>()
vc.title = settingCell?.leftText
vc.options = [.disabled, .LZO]
vc.selectedOption = configuration.compressionAlgorithm
vc.selectedOption = configuration.compressionAlgorithm ?? .disabled
vc.descriptionBlock = { $0.cellDescription }
vc.selectionBlock = { [weak self] in
self?.configuration.compressionAlgorithm = $0