비밀 미션
- 비밀 미션 이용 최소 금액 : 10캔 으로 설정
This commit is contained in:
		| @@ -104,7 +104,7 @@ struct LiveRoomDonationDialogView: View { | ||||
|                         .padding(.top, 16) | ||||
|                     } | ||||
|                      | ||||
|                     TextField("몇 캔을 후원할까요?", text: $donationCan) | ||||
|                     TextField(isSecret ? "10캔 이상 입력하세요" : "1캔 이상 입력하세요", text: $donationCan) | ||||
|                         .font(.custom(Font.medium.rawValue, size: 13.3)) | ||||
|                         .foregroundColor(Color.grayee) | ||||
|                         .padding(13.3) | ||||
| @@ -241,10 +241,17 @@ struct LiveRoomDonationDialogView: View { | ||||
|                             .background(Color.button) | ||||
|                             .cornerRadius(10) | ||||
|                             .onTapGesture { | ||||
|                                 if !donationCan.trimmingCharacters(in: .whitespaces).isEmpty, | ||||
|                                    let can = Int(donationCan) { | ||||
|                                     onClickDonation(can, donationMessage, isSecret) | ||||
|                                     isShowing = false | ||||
|                                 if !donationCan.trimmingCharacters(in: .whitespaces).isEmpty, let can = Int(donationCan) { | ||||
|                                     if isSecret && can < 10 { | ||||
|                                         errorMessage = "비밀 미션은 최소 10캔 이상부터 이용이 가능합니다." | ||||
|                                         isShowErrorPopup = true | ||||
|                                     } else if can < 1 { | ||||
|                                         errorMessage = "1캔 이상 후원하실 수 있습니다." | ||||
|                                         isShowErrorPopup = true | ||||
|                                     } else { | ||||
|                                         onClickDonation(can, donationMessage, isSecret) | ||||
|                                         isShowing = false | ||||
|                                     } | ||||
|                                 } else { | ||||
|                                     errorMessage = "1캔 이상 후원하실 수 있습니다." | ||||
|                                     isShowErrorPopup = true | ||||
|   | ||||
| @@ -447,7 +447,13 @@ final class LiveRoomViewModel: NSObject, ObservableObject { | ||||
|     } | ||||
|      | ||||
|     func donation(can: Int, message: String = "", isSecret: Bool = false) { | ||||
|         if can > 0 { | ||||
|         if isSecret && can < 10 { | ||||
|             popupContent = "비밀 미션은 최소 10캔 이상부터 이용이 가능합니다." | ||||
|             isShowPopup = true | ||||
|         } else if can < 1 { | ||||
|             popupContent = "1캔 이상 후원하실 수 있습니다." | ||||
|             isShowPopup = true | ||||
|         } else { | ||||
|             isLoading = true | ||||
|              | ||||
|             repository.donation(roomId: AppState.shared.roomId, can: can, message: message, isSecret: isSecret) | ||||
| @@ -567,9 +573,6 @@ final class LiveRoomViewModel: NSObject, ObservableObject { | ||||
|                     } | ||||
|                 } | ||||
|                 .store(in: &subscription) | ||||
|         } else { | ||||
|             popupContent = "1캔 이상 후원하실 수 있습니다." | ||||
|             isShowPopup = true | ||||
|         } | ||||
|     } | ||||
|      | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung