Include custom attr table in database cleanup

This commit is contained in:
MM20
2022-09-25 19:24:31 +02:00
parent 41766cc0ac
commit f1dbb84f61
3 changed files with 20 additions and 2 deletions
@@ -2,6 +2,7 @@ package de.mm20.launcher2.ui.settings.debug
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import de.mm20.launcher2.customattrs.CustomAttributesRepository
import de.mm20.launcher2.favorites.FavoritesRepository
import kotlinx.coroutines.launch
import org.koin.core.component.KoinComponent
@@ -9,8 +10,11 @@ import org.koin.core.component.inject
class DebugSettingsScreenVM: ViewModel(), KoinComponent {
val favoritesRepository: FavoritesRepository by inject()
private val favoritesRepository: FavoritesRepository by inject()
private val customAttributesRepository: CustomAttributesRepository by inject()
suspend fun cleanUpDatabase(): Int {
return favoritesRepository.cleanupDatabase()
var removed = favoritesRepository.cleanupDatabase()
removed += customAttributesRepository.cleanupDatabase()
return removed
}
}