diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index fd7ba3bca..1d2a4aee8 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -421,12 +421,6 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv self.navigationController?.setViewControllers([ self, searchController ], animated: true) } - @objc private func showPath() { - let pathVC = PathVC() - let navigationController = OWSNavigationController(rootViewController: pathVC) - present(navigationController, animated: true, completion: nil) - } - @objc func joinOpenGroup() { let joinOpenGroupVC = JoinOpenGroupVC() let navigationController = OWSNavigationController(rootViewController: joinOpenGroupVC) diff --git a/Session/Path/PathVC.swift b/Session/Path/PathVC.swift index 154eeed86..703f24e20 100644 --- a/Session/Path/PathVC.swift +++ b/Session/Path/PathVC.swift @@ -40,10 +40,6 @@ final class PathVC : BaseVC { private func setUpNavBar() { setUpNavBarStyle() setNavBarTitle(NSLocalizedString("vc_path_title", comment: "")) - // Set up close button - let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close)) - closeButton.tintColor = Colors.text - navigationItem.leftBarButtonItem = closeButton } private func setUpViewHierarchy() { @@ -167,10 +163,6 @@ final class PathVC : BaseVC { } // MARK: Interaction - @objc private func close() { - dismiss(animated: true, completion: nil) - } - @objc private func learnMore() { let urlAsString = "https://getsession.org/faq/#onion-routing" let url = URL(string: urlAsString)! diff --git a/Session/Settings/SettingsVC.swift b/Session/Settings/SettingsVC.swift index 64046bb71..973d5b583 100644 --- a/Session/Settings/SettingsVC.swift +++ b/Session/Settings/SettingsVC.swift @@ -244,7 +244,21 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { button.set(.height, to: SettingsVC.buttonHeight) return button } + + let pathButton = getSettingButton(withTitle: NSLocalizedString("vc_path_title", comment: ""), color: Colors.text, action: #selector(showPath)) + let pathStatusView = PathStatusView() + pathStatusView.set(.width, to: PathStatusView.size) + pathStatusView.set(.height, to: PathStatusView.size) + + pathButton.addSubview(pathStatusView) + pathStatusView.pin(.leading, to: .trailing, of: pathButton.titleLabel!, withInset: Values.smallSpacing) + pathStatusView.autoVCenterInSuperview() + + pathButton.titleEdgeInsets = UIEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: Values.smallSpacing) + return [ + getSeparator(), + pathButton, getSeparator(), getSettingButton(withTitle: NSLocalizedString("vc_settings_privacy_button_title", comment: ""), color: Colors.text, action: #selector(showPrivacySettings)), getSeparator(), @@ -480,6 +494,11 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { navigationController!.present(shareVC, animated: true, completion: nil) } + @objc private func showPath() { + let pathVC = PathVC() + navigationController!.pushViewController(pathVC, animated: true) + } + @objc private func showPrivacySettings() { let privacySettingsVC = PrivacySettingsTableViewController() navigationController!.pushViewController(privacySettingsVC, animated: true)