mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 23:25:20 +00:00
Fix build error: move PeerDisplayData struct outside ViewBuilder
- Move struct declaration to top level to avoid ViewBuilder error - Struct declarations cannot be inside ViewBuilder closures
This commit is contained in:
@@ -8,6 +8,17 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
// Pre-computed peer data for performance
|
||||
struct PeerDisplayData: Identifiable {
|
||||
let id: String
|
||||
let displayName: String
|
||||
let rssi: Int?
|
||||
let isFavorite: Bool
|
||||
let isMe: Bool
|
||||
let hasUnreadMessages: Bool
|
||||
let encryptionStatus: EncryptionStatus
|
||||
}
|
||||
|
||||
// Lazy loading wrapper for link previews
|
||||
struct LazyLinkPreviewView: View {
|
||||
let url: URL
|
||||
@@ -577,16 +588,6 @@ struct ContentView: View {
|
||||
let peersToShow: [String] = viewModel.connectedPeers
|
||||
|
||||
// Pre-compute peer data outside ForEach to reduce overhead
|
||||
struct PeerDisplayData: Identifiable {
|
||||
let id: String
|
||||
let displayName: String
|
||||
let rssi: Int?
|
||||
let isFavorite: Bool
|
||||
let isMe: Bool
|
||||
let hasUnreadMessages: Bool
|
||||
let encryptionStatus: EncryptionStatus
|
||||
}
|
||||
|
||||
let peerData = peersToShow.map { peerID in
|
||||
PeerDisplayData(
|
||||
id: peerID,
|
||||
|
||||
Reference in New Issue
Block a user