Fix performance for connection list

This commit is contained in:
世界
2025-12-06 19:37:21 +08:00
parent 2044535979
commit 5c7df0d608
4 changed files with 38 additions and 11 deletions
@@ -8,10 +8,14 @@ public struct ConnectionView: View {
self.connection = connection
}
private func format(_ date: Date) -> String {
private static let timeFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "HH:mm:ss"
return formatter.string(from: date)
return formatter
}()
private func format(_ date: Date) -> String {
Self.timeFormatter.string(from: date)
}
public func formatInterval(_ createdAt: Date, _ closedAt: Date) -> String {