mirror of
https://codeberg.org/timelimit/opentimelimit-android.git
synced 2025-10-05 10:49:29 +02:00
Unset category as category for unused apps when deleting category
This commit is contained in:
parent
fe062ecaa0
commit
5613029416
2 changed files with 4 additions and 0 deletions
|
@ -62,4 +62,7 @@ abstract class UserDao {
|
|||
|
||||
@Query("UPDATE user SET category_for_not_assigned_apps = :categoryId WHERE id = :childId")
|
||||
abstract fun updateCategoryForUnassignedApps(childId: String, categoryId: String)
|
||||
|
||||
@Query("UPDATE user SET category_for_not_assigned_apps = \"\" WHERE category_for_not_assigned_apps = :categoryId")
|
||||
abstract fun removeAsCategoryForUnassignedApps(categoryId: String)
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ object LocalDatabaseParentActionDispatcher {
|
|||
database.timeLimitRules().deleteTimeLimitRulesByCategory(action.categoryId)
|
||||
database.usedTimes().deleteUsedTimeItems(action.categoryId)
|
||||
database.categoryApp().deleteCategoryAppsByCategoryId(action.categoryId)
|
||||
database.user().removeAsCategoryForUnassignedApps(action.categoryId)
|
||||
database.category().deleteCategory(action.categoryId)
|
||||
}
|
||||
is UpdateCategoryTitleAction -> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue