diff --git a/Tokenary iOS/Screens/Accounts/AccountsListViewController.swift b/Tokenary iOS/Screens/Accounts/AccountsListViewController.swift index a695bbde..795a5381 100644 --- a/Tokenary iOS/Screens/Accounts/AccountsListViewController.swift +++ b/Tokenary iOS/Screens/Accounts/AccountsListViewController.swift @@ -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)