mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Touch up three column messaging
This commit is contained in:
parent
176ba630c6
commit
9e842e7559
3 changed files with 1 additions and 30 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,17 +80,9 @@ struct Messages: View {
|
|||
}
|
||||
|
||||
} content: {
|
||||
|
||||
ChannelList()
|
||||
UserList()
|
||||
|
||||
} detail: {
|
||||
if let user = userSelection {
|
||||
UserMessageList(user: user)
|
||||
|
||||
} else {
|
||||
Text("select.contact")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue