Opens Error Log when tapping ToastView

This commit is contained in:
nythepegasus
2024-05-06 19:55:44 -04:00
committed by ny
parent 4365ba0f1a
commit b024e67fee
8 changed files with 74 additions and 43 deletions

View File

@@ -92,6 +92,7 @@ final class SettingsViewController: UITableViewController
super.init(coder: aDecoder)
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openPatreonSettings(_:)), name: AppDelegate.openPatreonSettingsDeepLinkNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openErrorLog(_:)), name: ToastView.openErrorLogNotification, object: nil)
}
override func viewDidLoad()
@@ -109,16 +110,13 @@ final class SettingsViewController: UITableViewController
debugModeGestureRecognizer.numberOfTouchesRequired = 3
self.tableView.addGestureRecognizer(debugModeGestureRecognizer)
print(Bundle.main.infoDictionary)
var versionString: String = ""
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
{
versionString += "SideStore \(version)"
if let xcode = Bundle.main.object(forInfoDictionaryKey: "DTXcode") as? String {
print(xcode)
versionString += " - Xcode \(xcode) - "
if let build = Bundle.main.object(forInfoDictionaryKey: "DTXcodeBuild") as? String {
print(build)
versionString += "\(build)"
}
}
@@ -408,6 +406,15 @@ private extension SettingsViewController
self.performSegue(withIdentifier: "showPatreon", sender: nil)
}
}
@objc func openErrorLog(_: Notification) {
guard self.presentedViewController == nil else { return }
self.navigationController?.popViewController(animated: false)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.performSegue(withIdentifier: "showErrorLog", sender: nil)
}
}
}
extension SettingsViewController