Hide connections page by default since unstable
This commit is contained in:
@@ -8,7 +8,6 @@ public struct ConnectionListView: View {
|
||||
@State private var isLoading = true
|
||||
@StateObject private var commandClient = CommandClient(.connections)
|
||||
@State private var connections: [Connection] = []
|
||||
@State private var selection: ConnectionListPage = .active
|
||||
@State private var searchText = ""
|
||||
@State private var alert: Alert?
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public struct ConnectionView: View {
|
||||
Spacer()
|
||||
VStack(alignment: .trailing) {
|
||||
Text(connection.inboundType + "/" + connection.inbound)
|
||||
Text(connection.chain.reversed().joined(separator: "/"))
|
||||
Text(connection.chain[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public struct ConnectionView: View {
|
||||
|
||||
private nonisolated func closeConnection() async {
|
||||
do {
|
||||
try LibboxNewStandaloneCommandClient()!.closeConnection(connection.id)
|
||||
try await LibboxNewStandaloneCommandClient()!.closeConnection(connection.id)
|
||||
} catch {
|
||||
await MainActor.run {
|
||||
alert = Alert(error)
|
||||
|
||||
@@ -51,7 +51,7 @@ public struct ActiveDashboardView: View {
|
||||
#if os(iOS) || os(tvOS)
|
||||
if ApplicationLibrary.inPreview || profile.status.isConnectedStrict {
|
||||
Picker("Page", selection: $selection) {
|
||||
ForEach(DashboardPage.allCases) { page in
|
||||
ForEach(DashboardPage.enabledCases()) { page in
|
||||
page.label
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public struct ActiveDashboardView: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
TabView(selection: $selection) {
|
||||
ForEach(DashboardPage.enabledCases) { page in
|
||||
ForEach(DashboardPage.enabledCases()) { page in
|
||||
page.contentView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
|
||||
.tag(page)
|
||||
}
|
||||
|
||||
@@ -13,18 +13,18 @@ public enum DashboardPage: Int, CaseIterable, Identifiable {
|
||||
}
|
||||
|
||||
public extension DashboardPage {
|
||||
#if !tvOS
|
||||
static var enabledCases: [DashboardPage] = [
|
||||
.overview,
|
||||
.groups,
|
||||
.connections,
|
||||
]
|
||||
#else
|
||||
static var enabledCases: [DashboardPage] = [
|
||||
static func enabledCases() -> [DashboardPage] {
|
||||
var cases: [DashboardPage] = [
|
||||
.overview,
|
||||
.groups,
|
||||
]
|
||||
#endif
|
||||
#if !tvOS
|
||||
if Variant.isBeta {
|
||||
cases.append(.connections)
|
||||
}
|
||||
#endif
|
||||
return cases
|
||||
}
|
||||
}
|
||||
|
||||
public extension DashboardPage {
|
||||
|
||||
Reference in New Issue
Block a user