Fix login requests fetch triggered when device id is missing

This commit is contained in:
Rafał Kobyłko 2023-11-11 13:17:31 +01:00
parent 54bf4205eb
commit be0b9b8d88

View File

@ -104,9 +104,11 @@ internal class BrowserExtRepositoryImpl(
override suspend fun fetchTokenRequests() {
return withContext(dispatchers.io) {
observeMobileDevice().firstOrNull()?.id?.let { deviceId ->
val deviceId = observeMobileDevice().firstOrNull()?.id
if (deviceId.isNullOrBlank().not()) {
localSource.updateTokenRequests(
remoteSource.fetchTokenRequests(deviceId).map { it.asDomain() }
remoteSource.fetchTokenRequests(deviceId!!).map { it.asDomain() }
)
}
}