Skip to content

Commit

Permalink
fix: Re-enable dropdowns after reading initial state correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Oct 7, 2024
1 parent 641e747 commit 859a38c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fun TaskList(
}
Column(scrollModifier.padding(horizontal = 6.dp)) {
groupedTasks.forEachIndexed { groupIndex, tasksInGroup ->
var isGroupHidden by remember { mutableStateOf(false) }
var isGroupHidden by remember { mutableStateOf(tasksInGroup.firstOrNull()?.state?.completed == true) }
tasksInGroup.forEachIndexed { index, task ->
key(task.uuid) {
val selected = selectedTask?.taskId == task.uuid
Expand All @@ -112,9 +112,9 @@ fun TaskList(
val keyboardOpen by keyboardAsState()
val isGroupToggle = index == 0 && cachedTask.text.isGroupToggle()

// LaunchedEffect(cachedTask) {
// if (isGroupToggle) isGroupHidden = cachedTask.completed
// }
LaunchedEffect(cachedTask) {
if (isGroupToggle) isGroupHidden = cachedTask.completed
}

LaunchedEffect(keyboardOpen) {
if (!keyboardOpen) {
Expand Down

0 comments on commit 859a38c

Please sign in to comment.