Skip to content

Commit

Permalink
#1274 dismiss advanced triggers bottom sheet after choosing assistant…
Browse files Browse the repository at this point in the history
… trigger
  • Loading branch information
sds100 committed Nov 7, 2024
1 parent 8b4c088 commit 5235760
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -43,14 +40,13 @@ fun RecordTriggerButtonRow(
) {
val recordTriggerState by viewModel.recordTriggerState.collectAsState()
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
var showBottomSheet: Boolean by rememberSaveable { mutableStateOf(false) }

if (showBottomSheet) {
if (viewModel.showAdvancedTriggersBottomSheet) {
AdvancedTriggersBottomSheet(
modifier = Modifier.systemBarsPadding(),
viewModel = viewModel,
onDismissRequest = {
showBottomSheet = false
viewModel.showAdvancedTriggersBottomSheet
},
sheetState = sheetState,
)
Expand All @@ -61,7 +57,7 @@ fun RecordTriggerButtonRow(
onRecordTriggerClick = viewModel::onRecordTriggerButtonClick,
recordTriggerState = recordTriggerState,
onAdvancedTriggersClick = {
showBottomSheet = true
viewModel.showAdvancedTriggersBottomSheet = true
},
)
}
Expand Down

0 comments on commit 5235760

Please sign in to comment.