Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] 버튼 중복 클릭 문제 해결 #227

Merged
merged 3 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun DateRoadButton(
cornerRadius: Dp = 0.dp,
paddingHorizontal: Dp = 0.dp,
paddingVertical: Dp = 0.dp,
onClick: () -> Unit,
onClick: suspend () -> Unit,
content: @Composable () -> Unit
) {
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import org.sopt.dateroad.presentation.ui.component.dialog.DateRoadOneButtonDialo
import org.sopt.dateroad.presentation.ui.component.textfield.model.TextFieldValidateResult
import org.sopt.dateroad.presentation.ui.component.topbar.DateRoadBasicTopBar
import org.sopt.dateroad.presentation.ui.component.view.DateRoadErrorView
import org.sopt.dateroad.presentation.ui.component.view.DateRoadLoadingView
import org.sopt.dateroad.presentation.ui.enroll.component.EnrollPhotos
import org.sopt.dateroad.presentation.util.DatePicker
import org.sopt.dateroad.presentation.util.EnrollScreen.MAX_ITEMS
Expand Down Expand Up @@ -180,6 +181,8 @@ fun EnrollRoute(
viewModel.setEvent(EnrollContract.EnrollEvent.SetIsEnrollSuccessDialogOpen(isEnrollSuccessDialogOpen = true))
}

LoadState.Loading -> DateRoadLoadingView()

LoadState.Error -> DateRoadErrorView()

else -> Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ inline fun Modifier.noRippleClickable(
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun Modifier.noRippleDebounceClickable(
onClick: () -> Unit
onClick: suspend () -> Unit
): Modifier = composed {
var clickable by remember { mutableStateOf(true) }

pointerInteropFilter {
if (clickable) {
onClick()
clickable = false
CoroutineScope(Dispatchers.Main).launch {
delay(500) // 500밀리초 딜레이
onClick()
delay(500)
clickable = true
}
Comment on lines -39 to 44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 0.5보다 오래걸릴 때 두 번 갔던거구나

}
Expand Down
Loading