Add option for default MTU

This commit is contained in:
Davide De Rosa 2020-12-28 22:11:16 +01:00
parent d5abf4fb86
commit aff3a747b8
2 changed files with 9 additions and 4 deletions

View File

@ -614,11 +614,16 @@ extension NetworkSettingsViewController {
vc.applyTint(.current)
vc.title = (cell as? SettingTableViewCell)?.leftText
vc.options = ProfileNetworkSettings.mtuOptions
vc.descriptionBlock = { $0.description }
vc.descriptionBlock = {
guard $0 != 0 else {
return "Default"
}
return $0.description
}
vc.selectedOption = networkSettings.mtuBytes
vc.selectedOption = networkSettings.mtuBytes ?? 0
vc.selectionBlock = { [weak self] in
self?.networkSettings.mtuBytes = $0
self?.networkSettings.mtuBytes = ($0 != 0) ? $0 : nil
self?.navigationController?.popViewController(animated: true)
}
navigationController?.pushViewController(vc, animated: true)

@ -1 +1 @@
Subproject commit b8d72f3e58158dc185b34ac135d16837be28e5d1
Subproject commit d01d8c1d92d8b4f60b366240cb00549b062bad29