mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: clear data when changing devices (#1985)
This commit is contained in:
parent
ead0c43381
commit
25ecdc912e
7 changed files with 102 additions and 22 deletions
|
|
@ -81,7 +81,7 @@ class BTScanModel @Inject constructor(
|
|||
}
|
||||
|
||||
// Include a placeholder for "None"
|
||||
addDevice(DeviceListEntry(context.getString(R.string.none), "n", true))
|
||||
addDevice(DeviceListEntry(context.getString(R.string.none), NO_DEVICE_SELECTED, true))
|
||||
|
||||
if (showMockInterface) {
|
||||
addDevice(DeviceListEntry("Demo Mode", "m", true))
|
||||
|
|
@ -158,7 +158,7 @@ class BTScanModel @Inject constructor(
|
|||
val selectedBluetooth: Boolean get() = selectedAddress?.getOrNull(0) == 'x'
|
||||
|
||||
// / Use the string for the NopInterface
|
||||
val selectedNotNull: String get() = selectedAddress ?: "n"
|
||||
val selectedNotNull: String get() = selectedAddress ?: NO_DEVICE_SELECTED
|
||||
|
||||
val scanResult = MutableLiveData<MutableMap<String, DeviceListEntry>>(mutableMapOf())
|
||||
|
||||
|
|
@ -280,3 +280,5 @@ class BTScanModel @Inject constructor(
|
|||
private val _spinner = MutableLiveData(false)
|
||||
val spinner: LiveData<Boolean> get() = _spinner
|
||||
}
|
||||
|
||||
const val NO_DEVICE_SELECTED = "n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue