mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:25:19 +00:00
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:
@@ -291,15 +291,15 @@ struct ContentView: View {
|
||||
// Build stable UI IDs with a context key to avoid ID collisions when switching channels
|
||||
#if os(iOS)
|
||||
let contextKey: String = {
|
||||
if let peer = privatePeer { return "dm:\\(peer)" }
|
||||
if let peer = privatePeer { return "dm:\(peer)" }
|
||||
switch locationManager.selectedChannel {
|
||||
case .mesh: return "mesh"
|
||||
case .location(let ch): return "geo:\\(ch.geohash)"
|
||||
case .location(let ch): return "geo:\(ch.geohash)"
|
||||
}
|
||||
}()
|
||||
#else
|
||||
let contextKey: String = {
|
||||
if let peer = privatePeer { return "dm:\\(peer)" }
|
||||
if let peer = privatePeer { return "dm:\(peer)" }
|
||||
return "mesh"
|
||||
}()
|
||||
#endif
|
||||
@@ -400,15 +400,15 @@ struct ContentView: View {
|
||||
let step = 200
|
||||
#if os(iOS)
|
||||
let contextKey: String = {
|
||||
if let peer = privatePeer { return "dm:\\(peer)" }
|
||||
if let peer = privatePeer { return "dm:\(peer)" }
|
||||
switch locationManager.selectedChannel {
|
||||
case .mesh: return "mesh"
|
||||
case .location(let ch): return "geo:\\(ch.geohash)"
|
||||
case .location(let ch): return "geo:\(ch.geohash)"
|
||||
}
|
||||
}()
|
||||
#else
|
||||
let contextKey: String = {
|
||||
if let peer = privatePeer { return "dm:\\(peer)" }
|
||||
if let peer = privatePeer { return "dm:\(peer)" }
|
||||
return "mesh"
|
||||
}()
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user