Add pointless ToS nag before logging in

Thanks, App Review
This commit is contained in:
Shadowfacts 2024-08-08 20:39:55 -07:00
parent 18f6445a7c
commit eea0ef258c
1 changed files with 11 additions and 4 deletions

View File

@ -245,10 +245,17 @@ extension OnboardingViewController {
extension OnboardingViewController: InstanceSelectorTableViewControllerDelegate { extension OnboardingViewController: InstanceSelectorTableViewControllerDelegate {
func didSelectInstance(url instanceURL: URL) { func didSelectInstance(url instanceURL: URL) {
Task { let alert = UIAlertController(title: "Terms of Service", message: "By logging in to '\(instanceURL.host!)', you agree to follow all applicable rules and terms of service for that instance.", preferredStyle: .alert)
await self.login(to: instanceURL) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { [unowned self] _ in
instanceSelector.tableView.selectRow(at: nil, animated: true, scrollPosition: .none) self.instanceSelector.tableView.selectRow(at: nil, animated: false, scrollPosition: .none)
} }))
alert.addAction(UIAlertAction(title: "Continue", style: .default, handler: { [unowned self] _ in
Task {
await self.login(to: instanceURL)
self.instanceSelector.tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
}
}))
present(alert, animated: true)
} }
} }