Add server picker to Home

This commit is contained in:
Georg Bauer
2026-08-03 20:38:35 +02:00
parent 9a0b179a0e
commit 976742e173
2 changed files with 18 additions and 1 deletions

View File

@@ -33,6 +33,18 @@ final class HomeViewController: RefreshingTableViewController {
override func viewDidLoad() {
super.viewDidLoad()
let servers = UIBarButtonItem(
image: context.symbol("server.rack"),
primaryAction: UIAction { [weak self] _ in
guard let self else { return }
self.navigationController?.pushViewController(
ServersViewController(context: self.context),
animated: true
)
}
)
servers.accessibilityLabel = "Servers"
navigationItem.leftBarButtonItem = servers
let settings = UIBarButtonItem(
image: context.symbol("gearshape"),
primaryAction: UIAction { [weak self] _ in
@@ -57,7 +69,7 @@ final class HomeViewController: RefreshingTableViewController {
guard context.core.activeServerIndex() != nil else {
tableView.backgroundView = EmptyBackgroundView(
title: "No server selected",
detail: "Open Issues or Repos to select a server or add your first one."
detail: "Use the server button to select a server or add your first one."
)
refreshControl?.endRefreshing()
return