mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-19 15:48:19 -05:00
Merge branch 'dns-cache' into 'master'
Get all mirrors before deleting repo See merge request fdroid/fdroidclient!1507
This commit is contained in:
@@ -61,7 +61,6 @@ class RepoDetailsViewModel(
|
||||
}
|
||||
|
||||
private val repoId = initialRepo.repoId
|
||||
private val repoMirrors = initialRepo.getMirrors()
|
||||
|
||||
private val repoManager = FDroidApp.getRepoManager(app)
|
||||
private val appDao = DBHelper.getDb(app).getAppDao()
|
||||
@@ -104,14 +103,13 @@ class RepoDetailsViewModel(
|
||||
}
|
||||
|
||||
fun deleteRepository() {
|
||||
val cache = DnsCache.get()
|
||||
val mirrors = repoFlow.value?.getAllMirrors() ?: emptyList()
|
||||
mirrors.forEach { cache.remove(it.url.host) }
|
||||
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
repoManager.deleteRepository(repoId)
|
||||
}
|
||||
// clean up dns cache
|
||||
val cache = DnsCache.get()
|
||||
for (mirror in repoMirrors) {
|
||||
cache.remove(mirror.url.host)
|
||||
}
|
||||
}
|
||||
|
||||
fun updateUsernameAndPassword(username: String, password: String) {
|
||||
|
||||
Reference in New Issue
Block a user