Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for navigating to currently connected node info #837

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Meshtastic/Views/Bluetooth/Connect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct Connect: View {
@State var invalidFirmwareVersion = false
@State var liveActivityStarted = false
@State var selectedPeripherialId = ""
@State var navigateToMetricsLog = false

init () {
let notificationCenter = UNUserNotificationCenter.current()
Expand Down Expand Up @@ -84,10 +85,20 @@ struct Connect: View {
}
}
}
if bleManager.isSubscribed {
VStack(alignment: .trailing) {
Image(systemName: "chevron.right")
}
}
}
.font(.caption)
.foregroundColor(Color.gray)
.padding([.top, .bottom])
.onTapGesture {
if bleManager.isSubscribed {
navigateToMetricsLog = true
}
}
.swipeActions {
Button(role: .destructive) {
if let connectedPeripheral = bleManager.connectedPeripheral,
Expand Down Expand Up @@ -295,6 +306,15 @@ struct Connect: View {
)
}
)
.navigationDestination(isPresented: $navigateToMetricsLog) {
if let node {
NodeDetail(bleManager: _bleManager, connectedNode: node, node: node)
.navigationBarTitleDisplayMode(.inline)
}
}
.onAppear {
navigateToMetricsLog = false
}
}
.sheet(isPresented: $invalidFirmwareVersion, onDismiss: didDismissSheet) {
InvalidVersion(minimumVersion: self.bleManager.minimumVersion, version: self.bleManager.connectedVersion)
Expand Down