Reload table view when old account warning was acknowledged

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2024-10-22 21:14:13 +02:00
Родитель 6936968435
Коммит 5f22ca64de
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -5,8 +5,14 @@
import UIKit
@objc protocol CallsFromOldAccountViewControllerDelegate: AnyObject {
func callsFromOldAccountWarningAcknowledged()
}
class CallsFromOldAccountViewController: UIViewController {
weak var delegate: CallsFromOldAccountViewControllerDelegate?
@IBOutlet weak var warningTextLabel: UILabel!
@IBOutlet weak var acknowledgeWarningButton: NCButton!
@ -45,6 +51,7 @@ class CallsFromOldAccountViewController: UIViewController {
@IBAction func acknowledgeWarningButtonPressed(_ sender: Any) {
NCSettingsController.sharedInstance().setDidReceiveCallsFromOldAccount(false)
self.navigationController?.popViewController(animated: true)
self.delegate?.callsFromOldAccountWarningAcknowledged()
}
}

Просмотреть файл

@ -44,7 +44,7 @@ enum AboutSection: Int {
case kAboutSectionSourceCode
}
class SettingsTableViewController: UITableViewController, UITextFieldDelegate, UserStatusViewDelegate {
class SettingsTableViewController: UITableViewController, UITextFieldDelegate, UserStatusViewDelegate, CallsFromOldAccountViewControllerDelegate {
let kPhoneTextFieldTag = 99
let iconConfiguration = UIImage.SymbolConfiguration(pointSize: 18)
@ -588,10 +588,15 @@ class SettingsTableViewController: UITableViewController, UITextFieldDelegate, U
func callsFromOldAccountPressed() {
let vc = CallsFromOldAccountViewController()
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
}
func callsFromOldAccountWarningAcknowledged() {
self.tableView.reloadData()
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {