UI: fix string interpolation in DM/geohash context keys (remove escaped interpolation) to resolve 'unused ch' warnings and ensure proper IDs

This commit is contained in:
jack
2025-08-24 17:26:52 +02:00
parent fe098cdae9
commit 2c76a3c03e
+6 -6
View File
@@ -291,15 +291,15 @@ struct ContentView: View {
// Build stable UI IDs with a context key to avoid ID collisions when switching channels // Build stable UI IDs with a context key to avoid ID collisions when switching channels
#if os(iOS) #if os(iOS)
let contextKey: String = { let contextKey: String = {
if let peer = privatePeer { return "dm:\\(peer)" } if let peer = privatePeer { return "dm:\(peer)" }
switch locationManager.selectedChannel { switch locationManager.selectedChannel {
case .mesh: return "mesh" case .mesh: return "mesh"
case .location(let ch): return "geo:\\(ch.geohash)" case .location(let ch): return "geo:\(ch.geohash)"
} }
}() }()
#else #else
let contextKey: String = { let contextKey: String = {
if let peer = privatePeer { return "dm:\\(peer)" } if let peer = privatePeer { return "dm:\(peer)" }
return "mesh" return "mesh"
}() }()
#endif #endif
@@ -400,15 +400,15 @@ struct ContentView: View {
let step = 200 let step = 200
#if os(iOS) #if os(iOS)
let contextKey: String = { let contextKey: String = {
if let peer = privatePeer { return "dm:\\(peer)" } if let peer = privatePeer { return "dm:\(peer)" }
switch locationManager.selectedChannel { switch locationManager.selectedChannel {
case .mesh: return "mesh" case .mesh: return "mesh"
case .location(let ch): return "geo:\\(ch.geohash)" case .location(let ch): return "geo:\(ch.geohash)"
} }
}() }()
#else #else
let contextKey: String = { let contextKey: String = {
if let peer = privatePeer { return "dm:\\(peer)" } if let peer = privatePeer { return "dm:\(peer)" }
return "mesh" return "mesh"
}() }()
#endif #endif