mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix duplicate scan table entries when pairing state changes
This commit is contained in:
parent
db43f47f91
commit
fd100d4492
1 changed files with 4 additions and 4 deletions
|
|
@ -153,8 +153,8 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
|||
GeeksvilleApplication.currentActivity as MainActivity,
|
||||
addr
|
||||
)
|
||||
|
||||
devices.value = oldDevs + Pair(addr, entry) // trigger gui updates
|
||||
oldDevs[addr] = entry // Add/replace entry
|
||||
devices.value = oldDevs // trigger gui updates
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
|||
BTScanEntry("Meshtastic_32ac", "xb", true)
|
||||
)
|
||||
|
||||
devices.value = (testnodes.map { it.macAddress to it }).toMap()
|
||||
devices.value = (testnodes.map { it.macAddress to it }).toMap().toMutableMap()
|
||||
|
||||
// If nothing was selected, by default select the first thing we see
|
||||
if (selectedMacAddr == null)
|
||||
|
|
@ -229,7 +229,7 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
|||
}
|
||||
}
|
||||
|
||||
val devices = object : MutableLiveData<Map<String, BTScanEntry>>(mapOf()) {
|
||||
val devices = object : MutableLiveData<MutableMap<String, BTScanEntry>>(mutableMapOf()) {
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue