parent
48dc31a1f1
commit
12d3bd20f5
|
@ -57,7 +57,7 @@ struct Issue: Identifiable {
|
|||
purchasedProducts: Set<AppProduct>,
|
||||
appLog: Data? = nil,
|
||||
tunnelLog: Data? = nil,
|
||||
providerId: ProviderID?
|
||||
providerId: ProviderID? = nil
|
||||
) {
|
||||
id = UUID()
|
||||
self.appLine = appLine
|
||||
|
|
|
@ -60,6 +60,7 @@ struct VPNProviderServerView<Configuration>: View where Configuration: ProviderC
|
|||
debugChanges()
|
||||
return Subview(
|
||||
manager: manager,
|
||||
selectedServer: selectedEntity?.server,
|
||||
filters: $filters,
|
||||
onSelect: selectServer
|
||||
)
|
||||
|
|
|
@ -34,6 +34,8 @@ extension VPNProviderServerView {
|
|||
@ObservedObject
|
||||
var manager: VPNProviderManager<Configuration>
|
||||
|
||||
let selectedServer: VPNServer?
|
||||
|
||||
@Binding
|
||||
var filters: VPNFilters
|
||||
|
||||
|
@ -85,7 +87,7 @@ private extension VPNProviderServerView.Subview {
|
|||
countryServers(for: code)
|
||||
.map { servers in
|
||||
DisclosureGroup {
|
||||
ForEach(servers, id: \.serverId, content: serverView)
|
||||
ForEach(servers, id: \.id, content: serverView)
|
||||
} label: {
|
||||
HStack {
|
||||
ThemeCountryFlag(code: code)
|
||||
|
@ -99,7 +101,12 @@ private extension VPNProviderServerView.Subview {
|
|||
Button {
|
||||
onSelect(server)
|
||||
} label: {
|
||||
Text(server.hostname ?? server.id)
|
||||
HStack {
|
||||
Text(server.hostname ?? server.serverId)
|
||||
Spacer()
|
||||
ThemeImage(.marked)
|
||||
.opacity(server.id == selectedServer?.id ? 1.0 : 0.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ extension VPNProviderServerView {
|
|||
@ObservedObject
|
||||
var manager: VPNProviderManager<Configuration>
|
||||
|
||||
let selectedServer: VPNServer?
|
||||
|
||||
@Binding
|
||||
var filters: VPNFilters
|
||||
|
||||
|
@ -50,7 +52,7 @@ extension VPNProviderServerView {
|
|||
|
||||
private extension VPNProviderServerView.Subview {
|
||||
var tableView: some View {
|
||||
Table(manager.filteredServers) {
|
||||
Table(manager.filteredServers, selection: .constant(selectedServer?.id)) {
|
||||
TableColumn(Strings.Global.region) { server in
|
||||
HStack {
|
||||
ThemeCountryFlag(code: server.provider.countryCode)
|
||||
|
|
Loading…
Reference in New Issue