fix: initialize devices before constructor execution

This commit is contained in:
andrekir
2023-04-06 19:08:19 -03:00
parent 189e9aeee4
commit 4e9ec5f096

View File

@@ -43,6 +43,7 @@ class BTScanModel @Inject constructor(
) : ViewModel(), Logging {
private val context: Context get() = application.applicationContext
val devices = MutableLiveData<MutableMap<String, DeviceListEntry>>(mutableMapOf())
init {
bluetoothRepository.state.value.bondedDevices.onEach {
@@ -341,8 +342,6 @@ class BTScanModel @Inject constructor(
)
}
val devices = MutableLiveData<MutableMap<String, DeviceListEntry>>(mutableMapOf())
private val _changeDeviceAddress = MutableLiveData<String?>(null)
val changeDeviceAddress: LiveData<String?> get() = _changeDeviceAddress