From aff3a747b860c9ec9435b11f09afe6144440c765 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Mon, 28 Dec 2020 22:11:16 +0100 Subject: [PATCH] Add option for default MTU --- .../Scenes/NetworkSettingsViewController.swift | 11 ++++++++--- Submodules/Core | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Passepartout-iOS/Scenes/NetworkSettingsViewController.swift b/Passepartout-iOS/Scenes/NetworkSettingsViewController.swift index 9c467384..eb2daead 100644 --- a/Passepartout-iOS/Scenes/NetworkSettingsViewController.swift +++ b/Passepartout-iOS/Scenes/NetworkSettingsViewController.swift @@ -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) diff --git a/Submodules/Core b/Submodules/Core index b8d72f3e..d01d8c1d 160000 --- a/Submodules/Core +++ b/Submodules/Core @@ -1 +1 @@ -Subproject commit b8d72f3e58158dc185b34ac135d16837be28e5d1 +Subproject commit d01d8c1d92d8b4f60b366240cb00549b062bad29