maps: feat: rename subscription groups
- Commit
a997476cef3027759c8a5d53ccc21a8d7e0fd3c8- Author
- Vayun Mathur <[email protected]>
- When
- 2026-02-08 06:11 UTC (10 months ago)
- Parents
58529a0
Diff
youpipe/src/main/java/com/vayunmathur/youpipe/data/SubscriptionCategory.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/data/SubscriptionCategory.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/data/SubscriptionCategory.ktindex 07001a26ab..ec366aace6 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/data/SubscriptionCategory.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/data/SubscriptionCategory.kt@@ -36,8 +36,8 @@ interface SubscriptionCategoryDao: TrueDao<SubscriptionCategory> { suspend fun deleteCategory(categoryName: String) @Transaction- suspend fun replaceCategory(categoryName: String, map: List<Long>) {- deleteCategory(categoryName)+ suspend fun replaceCategory(originalCategoryName: String?, categoryName: String, map: List<Long>) {+ if(originalCategoryName != null) deleteCategory(originalCategoryName) upsertAll(map.mapIndexed { index, id -> SubscriptionCategory(id, categoryName) }) } }\ No newline at end of file
youpipe/src/main/java/com/vayunmathur/youpipe/ui/dialog/CreateSubscriptionCategory.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/dialog/CreateSubscriptionCategory.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/dialog/CreateSubscriptionCategory.ktindex 7335b99e4a..2d2aaab18d 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/dialog/CreateSubscriptionCategory.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/dialog/CreateSubscriptionCategory.kt@@ -66,7 +66,7 @@ fun CreateSubscriptionCategory(backStack: NavBackStack<Route>, viewModel: Databa else Text("Update subscription category", style = MaterialTheme.typography.titleLarge) Spacer(Modifier.height(8.dp))- OutlinedTextField(categoryName, {categoryName = it}, label = {Text("Category name")}, enabled = id == null)+ OutlinedTextField(categoryName, {categoryName = it}, label = {Text("Category name")}) Spacer(Modifier.height(8.dp)) Text("Select subscriptions:") LazyColumn(Modifier.weight(1f)) {@@ -93,6 +93,7 @@ fun CreateSubscriptionCategory(backStack: NavBackStack<Route>, viewModel: Databa { coroutineScope.launch { categoriesDao.replaceCategory(+ id, categoryName, selectedSubscriptions.map { it.id }) backStack.pop()