mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 22:05:59 +00:00
Order TrustedDevicesView by date
This commit is contained in:
1 parent
e895e7a68e
commit
74226d2fc3
1 file changed
+14
-15
@@ -55,25 +55,24 @@ struct TrustedDevicesView: View {
|
|||||||
|
|
||||||
|
|
||||||
var devicesView: some View {
|
var devicesView: some View {
|
||||||
ForEach(Array(store.trustedCertificates.keys), id: \.self) { key in
|
let entries = store.trustedCertificates.sorted { $0.value.creationDate < $1.value.creationDate }
|
||||||
if let cert = store.trustedCertificates[key] {
|
return ForEach(entries, id: \.key) { key, cert in
|
||||||
HStack {
|
HStack {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
LUIText(cert.device.name ?? "Unknown".localized(), isBold: true)
|
LUIText(cert.device.name ?? "Unknown".localized(), isBold: true)
|
||||||
LUIText(Self.dateFormatter.string(from: cert.creationDate), color: .mainColor.opacity(0.7))
|
LUIText(Self.dateFormatter.string(from: cert.creationDate), color: .mainColor.opacity(0.7))
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
LUIButton {
|
LUIButton {
|
||||||
deviceToRemove = key
|
deviceToRemove = key
|
||||||
showRemoveAlert = true
|
showRemoveAlert = true
|
||||||
} label: {
|
} label: {
|
||||||
ReorderListIcon(imageName: "minus.circle.fill", color: .red)
|
ReorderListIcon(imageName: "minus.circle.fill", color: .red)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding(.vertical, 8)
|
|
||||||
}
|
}
|
||||||
|
.padding(.vertical, 8)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user