@@ -5,6 +5,7 @@ import androidx.compose.foundation.clickable
55import androidx.compose.foundation.layout.*
66import androidx.compose.foundation.lazy.LazyColumn
77import androidx.compose.foundation.lazy.items
8+ import androidx.compose.foundation.shape.RoundedCornerShape
89import androidx.compose.material.icons.Icons
910import androidx.compose.material.icons.filled.*
1011import 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
2628fun 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