fix(infrared): propagate repository storage errors and recover learning keys across effective profiles
This commit is contained in:
+2
@@ -134,10 +134,12 @@ class FakeInfraredKeyRepository : InfraredKeyRepository {
|
||||
class FakeInfraredDeviceConfigurationRepository : InfraredDeviceConfigurationRepository {
|
||||
private val lock = Any()
|
||||
private val deviceNames = MutableStateFlow<Map<ProviderProfileId, DeviceName>>(emptyMap())
|
||||
var observeError: DomainError? = null
|
||||
|
||||
override fun observeDeviceName(
|
||||
profileId: ProviderProfileId,
|
||||
): Flow<DomainResult<DeviceName?>> = deviceNames.map { values ->
|
||||
observeError?.let { return@map DomainResult.Failure(it) }
|
||||
DomainResult.Success(values[profileId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user