Setup connect button on iOS

This commit is contained in:
Ivan Grachev 2022-08-24 17:39:03 +03:00
parent ffbe969759
commit f6ae749f73

View File

@ -96,6 +96,10 @@ class AccountsListViewController: UIViewController, DataStateContainer {
tableView.contentInset.top += 70
tableView.verticalScrollIndicatorInsets.bottom += bottomOverlayHeight
// TODO: select all correct initiall cells
// tableView.selectRow(at: IndexPath(row: 0, section: 0), animated: true, scrollPosition: .none)
updatePrimaryButton()
if let peer = selectAccountAction?.peer {
websiteNameLabel.text = peer.name
if let urlString = peer.iconURLString, let url = URL(string: urlString) {
@ -136,6 +140,10 @@ class AccountsListViewController: UIViewController, DataStateContainer {
}
}
private func updatePrimaryButton() {
primaryButton.isEnabled = selectAccountAction?.selectedAccounts.isEmpty == false
}
private func updateCellModels() {
sections = []
var privateKeyAccountCellModels = [CellModel]()
@ -523,10 +531,12 @@ extension AccountsListViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
// TODO: implement deselect
updatePrimaryButton()
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// TODO: implement new account selection logic
updatePrimaryButton()
return
tableView.deselectRow(at: indexPath, animated: true)