fix(live-room): 좋아해요 미가용 시 롱프레스 중단 및 안내
- 하트 버튼 롱프레스 중 이면 즉시 진행 중단 및 로 안내 다이얼로그 표시. - pressing 핸들러에서 시작 즉시 가용성 체크 + 상태 초기화: , , , . - onLongPress 콜백에서도 동일 조건 재검사(2차 방어). 관련 파일: LiveRoomViewV2.swift
This commit is contained in:
@@ -263,13 +263,28 @@ struct LiveRoomViewV2: View {
|
|||||||
LiveRoomRightBottomButton(
|
LiveRoomRightBottomButton(
|
||||||
imageName: "ic_heart_pink",
|
imageName: "ic_heart_pink",
|
||||||
onClick: { viewModel.likeHeart() },
|
onClick: { viewModel.likeHeart() },
|
||||||
onLongPress: { viewModel.likeHeart(messageType: .BIG_HEART_DONATION, heartCount: 100) }
|
onLongPress: {
|
||||||
|
if !viewModel.isAvailableLikeHeart {
|
||||||
|
viewModel.isShowNoticeLikeHeart = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
viewModel.likeHeart(messageType: .BIG_HEART_DONATION, heartCount: 100)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
.onLongPressGesture(
|
.onLongPressGesture(
|
||||||
minimumDuration: 2.0,
|
minimumDuration: 2.0,
|
||||||
maximumDistance: 50,
|
maximumDistance: 50,
|
||||||
pressing: { pressing in
|
pressing: { pressing in
|
||||||
if pressing {
|
if pressing {
|
||||||
|
// 좋아해요 사용 가능 여부 체크: 불가 시 즉시 중단하고 안내 노출
|
||||||
|
if !viewModel.isAvailableLikeHeart {
|
||||||
|
isLongPressingHeart = false
|
||||||
|
showWaterHeart = false
|
||||||
|
waterProgress = 0
|
||||||
|
longPressStartAt = nil
|
||||||
|
viewModel.isShowNoticeLikeHeart = true
|
||||||
|
return
|
||||||
|
}
|
||||||
if !isLongPressingHeart {
|
if !isLongPressingHeart {
|
||||||
isLongPressingHeart = true
|
isLongPressingHeart = true
|
||||||
longPressStartAt = Date()
|
longPressStartAt = Date()
|
||||||
|
|||||||
Reference in New Issue
Block a user