Skip to content

Commit

Permalink
Replace Modifier.let {} with .then()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Dec 1, 2024
1 parent f1ea7ea commit 1b622e0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions core/src/commonMain/kotlin/Dialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,15 @@ public fun Dialog(
Modal(onKeyEvent = onKeyEvent) {
Box(
modifier = Modifier.fillMaxSize()
.let {
if (properties.dismissOnClickOutside) {
it.pointerInput(Unit) {
detectTapGestures {
currentDismiss()
scope.dialogState.visible = false
}
.then(if (properties.dismissOnClickOutside) {
Modifier.pointerInput(Unit) {
detectTapGestures {
currentDismiss()
scope.dialogState.visible = false
}
} else it
},
}
} else Modifier
),
contentAlignment = Alignment.Center
) {
scope.content()
Expand Down

0 comments on commit 1b622e0

Please sign in to comment.