mirror of
https://github.com/twofas/2fas-android.git
synced 2024-11-22 02:09:58 +01:00
Allow domain to be matched only once
This commit is contained in:
parent
e439029b2f
commit
e7f447c185
@ -80,6 +80,18 @@ internal class ServicesRepositoryImpl(
|
||||
return
|
||||
}
|
||||
|
||||
// Remove duplicates
|
||||
val matchingServices = localData.selectAll().filter { it.assignedDomains.contains(domain.lowercase()) }
|
||||
|
||||
matchingServices.forEach { matched ->
|
||||
localData.updateServiceSuspend(
|
||||
matched.copy(
|
||||
assignedDomains = matched.assignedDomains.minus(domain.lowercase()),
|
||||
updatedAt = timeProvider.systemCurrentTime(),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
localData.updateServiceSuspend(
|
||||
service.copy(
|
||||
assignedDomains = service.assignedDomains.plus(domain.lowercase()),
|
||||
|
Loading…
Reference in New Issue
Block a user