This commit is contained in:
fmodf 2024-10-20 20:46:31 +02:00
parent d6f08ca691
commit 78de092b06

View file

@ -26,29 +26,25 @@ struct ContactsScreen: View {
)
// Contacts list
contactsList
}
}
}
@ViewBuilder private var contactsList: some View {
if !clientsStore.actualRosters.isEmpty {
List {
ForEach(elements.indices, id: \.self) { index in
let element = elements[index]
if let roster = element as? Roster {
ContactsScreenRow(
roster: roster
)
} else if let bareJid = element as? String {
SharedSectionTitle(text: bareJid)
if !clientsStore.actualRosters.isEmpty {
List {
ForEach(elements.indices, id: \.self) { index in
let element = elements[index]
if let roster = element as? Roster {
ContactsScreenRow(
roster: roster
)
} else if let bareJid = element as? String {
SharedSectionTitle(text: bareJid)
}
}
}
.listStyle(.plain)
.background(Color.Material.Background.light)
} else {
Spacer()
}
}
.listStyle(.plain)
.background(Color.Material.Background.light)
} else {
Spacer()
}
}