Skip to content
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 @@ -35,11 +35,13 @@ final class LoginView: BaseView {
appleLoginButton.do {
$0.setImage(.appleLoginButton, for: .normal)
$0.alpha = 0
$0.isExclusiveTouch = true
}

kakaoLoginButton.do {
$0.setImage(.kakaoLoginButton, for: .normal)
$0.alpha = 0
$0.isExclusiveTouch = true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

중복 터치를 막아주는군요!

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ extension LoginViewController{
@objc
private func kakaoLoginButtonDidTap() {
rootView.kakaoLoginButton.isUserInteractionEnabled = false
rootView.appleLoginButton.isUserInteractionEnabled = false
self.platform = .KAKAO
viewModel.action(.socialLoginButtonDidTap(platform: .KAKAO))
}

@objc
private func appleLoginButtonDidTap() {
rootView.kakaoLoginButton.isUserInteractionEnabled = false
rootView.appleLoginButton.isUserInteractionEnabled = false
self.platform = .APPLE
viewModel.action(.socialLoginButtonDidTap(platform: .APPLE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ final class LoginViewModel: NSObject {
}

private var cancellables = Set<AnyCancellable>()

private var isSocialLoginInProgress = false

private let socialLoginUseCase: SocialLoginUseCase
private let getIsRegisteredUseCase: GetIsRegisteredUseCase
private let getUserIDUseCase: GetUserIDUseCase
Expand Down Expand Up @@ -60,7 +61,15 @@ extension LoginViewModel {

extension LoginViewModel {
private func socialLogin(platform: LoginPlatform) {
guard !isSocialLoginInProgress else {
ByeBooLogger.debug("이미 진행중인 요청 있음")
return
}
isSocialLoginInProgress = true

Task {
defer { isSocialLoginInProgress = false }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Task 안에도 defer문 선언이 가능하군요! 배워갑니다


do {
let _ = try await socialLoginUseCase.execute(platform: platform)
socialLoginAuthSubject.send(.success(()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ final class QuestContentView: BaseView {
$0.spacing = 4.adjustedW
}
}
likeContainerView.do {
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(likeButtonDidTap))
$0.addGestureRecognizer(tapRecognizer)
$0.isUserInteractionEnabled = true
}
likeButton.do {
$0.setImage(.heartOff, for: .normal)
$0.setImage(.heartOn, for: .selected)
$0.addTarget(self, action: #selector(likeButtonDidTap), for: .touchUpInside)
$0.isUserInteractionEnabled = false
}
commentIcon.do {
$0.image = .comment
Expand Down
Loading