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

Conversation

jihyunniiii
Copy link
Contributor

Related issue 🛠

Work Description ✏️

  • 버튼이 중복 클릭되는 문제를 해결하였습니다.

Screenshot 📸

Screen_recording_20240830_235720.mp4

아무튼 연속 클릭 하고 있는 거임,,!

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

  1. noRippleDebounceClickable에 suspend 추가
    기존에 0.5초의 딜레이를 주어 중복 클릭을 막아두었지만, 서버 통신에서 0.5초 이상의 시간이 걸리는 경우 (멀티파트라 아무래도 오래 걸리는 듯요 ㅠㅠ) 요청이 여러 번 가는 문제를 확인했습니다. 그래서 Clickable 함수에 suspend를 추가하고 로직을 일부 수정하여 서버통신 완료 후 0.5초의 딜레이를 주는 것으로 로직을 변경하였습니다.
  2. EnrollScreen에 LodingView 추가
    EnrollScreen에 로딩뷰를 추가해두지 않아 중복 클릭의 위험이 더 증가한다고 판단하였습니다. 따라서 이를 방지하고자 (+ 다른 뷰와의 통일성을 유지하고자) EnrollScreen에 로딩뷰를 추가하였습니다.

Copy link
Member

@t1nm1ksun t1nm1ksun left a comment

Choose a reason for hiding this comment

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

suspend 나이승

Comment on lines -39 to 44
onClick()
clickable = false
CoroutineScope(Dispatchers.Main).launch {
delay(500) // 500밀리초 딜레이
onClick()
delay(500)
clickable = true
}
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보다 오래걸릴 때 두 번 갔던거구나

@jihyunniiii jihyunniiii merged commit 461f067 into develop Sep 1, 2024
1 check passed
@jihyunniiii jihyunniiii deleted the fix-double-click branch September 1, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[fix] 버튼 중복 클릭 문제 해결
2 participants