Skip to content

Commit 5ac9f44

Browse files
committed
Fix remaining BatchOperationsScreen compilation errors
- Replace insertOrUpdate with update (profiles already exist in DB) - Add RoundedCornerShape import - Add @OptIn annotation for experimental Material3 API
1 parent 741e372 commit 5ac9f44

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/com/opentasker/ui/screens/BatchOperationsScreen.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.foundation.clickable
55
import androidx.compose.foundation.layout.*
66
import androidx.compose.foundation.lazy.LazyColumn
77
import androidx.compose.foundation.lazy.items
8+
import androidx.compose.foundation.shape.RoundedCornerShape
89
import androidx.compose.material.icons.Icons
910
import androidx.compose.material.icons.filled.*
1011
import androidx.compose.material3.*
@@ -22,6 +23,7 @@ import kotlinx.coroutines.launch
2223
* Screen for batch operations on profiles: multi-select, enable/disable/delete all.
2324
* Supports search/filter by profile name or context type.
2425
*/
26+
@OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
2527
@Composable
2628
fun BatchOperationsScreen(
2729
db: AppDatabase,
@@ -90,7 +92,7 @@ fun BatchOperationsScreen(
9092
scope.launch {
9193
selectedIds.forEach { id ->
9294
val profile = allProfiles.find { it.id == id } ?: return@forEach
93-
db.profileDao().insertOrUpdate(profile.copy(enabled = true).toEntity())
95+
db.profileDao().update(profile.copy(enabled = true).toEntity())
9496
}
9597
selectedIds = emptySet()
9698
}
@@ -107,7 +109,7 @@ fun BatchOperationsScreen(
107109
scope.launch {
108110
selectedIds.forEach { id ->
109111
val profile = allProfiles.find { it.id == id } ?: return@forEach
110-
db.profileDao().insertOrUpdate(profile.copy(enabled = false).toEntity())
112+
db.profileDao().update(profile.copy(enabled = false).toEntity())
111113
}
112114
selectedIds = emptySet()
113115
}

0 commit comments

Comments
 (0)