Connected watch updates

This commit is contained in:
Garth Vander Houwen 2026-04-20 09:03:01 -07:00
parent 82f28301ca
commit 704c08803c
2 changed files with 7 additions and 2 deletions

View file

@ -37,6 +37,12 @@ final class WatchSessionManager: NSObject, ObservableObject {
// MARK: - Public API
/// Whether a paired Watch with the Meshtastic app installed is available.
var isWatchAvailable: Bool {
guard let session, session.activationState == .activated else { return false }
return session.isPaired && session.isWatchAppInstalled
}
/// Send a specific node to the Watch as a foxhunt target.
/// The Watch will pin this node in its foxhunt list regardless of distance.
func sendNodeForFoxhunt(_ nodeNum: Int64) {

View file

@ -8,7 +8,6 @@ import WeatherKit
import MapKit
import CoreLocation
import OSLog
import WatchConnectivity
struct NodeDetail: View {
private let gridItemLayout = Array(repeating: GridItem(.flexible(), spacing: 10), count: 2)
@ -480,7 +479,7 @@ struct NodeDetail: View {
}
if node.hasPositions {
#if !targetEnvironment(macCatalyst)
if node.latestPosition?.isPreciseLocation == true && WCSession.isSupported() && WCSession.default.isPaired && WCSession.default.isWatchAppInstalled {
if node.latestPosition?.isPreciseLocation == true && WatchSessionManager.shared.isWatchAvailable {
Button {
WatchSessionManager.shared.sendNodeForFoxhunt(node.num)
} label: {