fix(chat): 채팅 쿼터 구매 동선을 정리한다

This commit is contained in:
Yu Sung
2026-07-12 21:59:04 +09:00
parent 4f271a77ee
commit c9570fc735
5 changed files with 18 additions and 27 deletions

View File

@@ -149,9 +149,6 @@ struct ChatRoomView: View {
if viewModel.showQuotaNoticeView {
ChatQuotaNoticeItemView(
onSelectAd: {
viewModel.showRewardedAdForChatQuota()
},
onSelectCan10: {
viewModel.purchaseChatQuota(canOption: .can10)
},

View File

@@ -279,9 +279,16 @@ final class ChatRoomViewModel: ObservableObject {
func showRewardedAdForChatQuota() {
_Concurrency.Task {
await YandexRewardedAdManager.shared.showAdIfAvailable(for: .chatRoomQuota) { [weak self] in
let isShown = await YandexRewardedAdManager.shared.showAdIfAvailable(for: .chatRoomQuota) { [weak self] in
self?.purchaseChatQuota(chargeType: .ad, canOption: nil)
}
if !isShown {
await MainActor.run {
errorMessage = I18n.Chat.Room.rewardedAdLoadFailed
isShowPopup = true
}
}
}
}

View File

@@ -9,31 +9,11 @@ import SwiftUI
struct ChatQuotaNoticeItemView: View {
let onSelectAd: () -> Void
let onSelectCan10: () -> Void
let onSelectCan20: () -> Void
var body: some View {
VStack(spacing: 10) {
Button {
onSelectAd()
} label: {
Text(I18n.Chat.Room.quotaAdAction(chatCount: 5))
.appFont(size: 18, weight: .bold)
.foregroundColor(Color(hex: "263238"))
.frame(maxWidth: .infinity)
.padding(.vertical, 14)
}
.frame(maxWidth: .infinity)
.background(Color(hex: "FEF8E3"))
.cornerRadius(30)
.overlay {
RoundedRectangle(cornerRadius: 30)
.stroke(lineWidth: 1)
.foregroundColor(Color(hex: "F7CB50"))
}
.buttonStyle(.plain)
HStack(spacing: 8) {
Button {
onSelectCan10()
@@ -80,7 +60,6 @@ struct ChatQuotaNoticeItemView: View {
#Preview {
ChatQuotaNoticeItemView(
onSelectAd: {},
onSelectCan10: {},
onSelectCan20: {}
)