diff --git a/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/ConfirmDialog.kt b/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/ConfirmDialog.kt index 11ed36e..96e6cc5 100644 --- a/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/ConfirmDialog.kt +++ b/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/ConfirmDialog.kt @@ -26,7 +26,7 @@ fun ConfirmDialog( dismissText: String = stringResource(OpenOtpResources.strings.cancel_button_name), confirmText: String = stringResource(OpenOtpResources.strings.proceed_button_name), ) { - Dialog(onDismissRequest = { onDismissRequest() }) { + Dialog(onDismissRequest = onDismissRequest) { Card( modifier = Modifier .wrapContentSize() diff --git a/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/OtpCodeItems.kt b/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/OtpCodeItems.kt index 55fd3f9..f0c0c4d 100644 --- a/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/OtpCodeItems.kt +++ b/shared/src/commonMain/kotlin/ml/dev/kotlin/openotp/ui/component/OtpCodeItems.kt @@ -100,9 +100,8 @@ internal fun OtpCodeItems( } ) } - when (val dismissed = dismissedCode) { - null -> Unit - else -> ConfirmDialog( + dismissedCode?.let { dismissed -> + ConfirmDialog( onDismissRequest = { dismissedCode = null }, onConfirmation = { dismissedCode = null