Touch up three column messaging

This commit is contained in:
Garth Vander Houwen 2023-08-29 22:21:02 -07:00
parent 176ba630c6
commit 9e842e7559
3 changed files with 1 additions and 30 deletions

View file

@ -17,6 +17,7 @@ struct ChannelList: View {
@State private var channelSelection: ChannelEntity? // Nothing selected by default.
@State private var isPresentingDeleteChannelMessagesConfirm: Bool = false
@State private var isPresentingTraceRouteSentAlert = false
var body: some View {
@ -145,7 +146,6 @@ struct ChannelList: View {
.padding([.top, .bottom])
}
}
.listStyle(.grouped)
.navigationTitle("channels")
}
}

View file

@ -80,17 +80,9 @@ struct Messages: View {
}
} content: {
ChannelList()
UserList()
} detail: {
if let user = userSelection {
UserMessageList(user: user)
} else {
Text("select.contact")
}
}
}
}

View file

@ -27,8 +27,6 @@ struct UserList: View {
let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMMdd", options: 0, locale: Locale.current)
let dateFormatString = (localeDateFormat ?? "MM/dd/YY")
List {
ForEach(users) { (user: UserEntity) in
let mostRecent = user.messageList.last
@ -143,25 +141,6 @@ struct UserList: View {
}
}
}
.listStyle(.grouped)
.navigationTitle("contacts")
.onAppear {
self.bleManager.context = context
if UserDefaults.preferredPeripheralId.count > 0 {
let fetchNodeInfoRequest: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest.init(entityName: "NodeInfoEntity")
fetchNodeInfoRequest.predicate = NSPredicate(format: "num == %lld", Int64(bleManager.connectedPeripheral?.num ?? -1))
do {
guard let fetchedNode = try context.fetch(fetchNodeInfoRequest) as? [NodeInfoEntity] else {
return
}
// Found a node, check it for a region
if !fetchedNode.isEmpty {
node = fetchedNode[0]
}
} catch {
}
}
}
}
}