fix(my-page): 비한국 국가 쿠폰 등록 노출 조건을 조정한다
This commit is contained in:
@@ -26,6 +26,7 @@ struct MyPageView: View {
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.uppercased()
|
||||
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
||||
let shouldShowCouponRegister = isKoreanCountry || UserDefaults.isAdultContentVisible()
|
||||
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty &&
|
||||
@@ -121,6 +122,7 @@ struct MyPageView: View {
|
||||
isShowAuthView: $viewModel.isShowAuthView,
|
||||
isAuthenticated: viewModel.isAuth,
|
||||
isKoreanCountry: isKoreanCountry,
|
||||
shouldShowCouponRegister: shouldShowCouponRegister,
|
||||
showMessage: {
|
||||
viewModel.errorMessage = $0
|
||||
viewModel.isShowPopup = true
|
||||
@@ -389,6 +391,7 @@ struct CategoryButtonsView: View {
|
||||
|
||||
let isAuthenticated: Bool
|
||||
let isKoreanCountry: Bool
|
||||
let shouldShowCouponRegister: Bool
|
||||
let showMessage: (String) -> Void
|
||||
let refresh: () -> Void
|
||||
|
||||
@@ -402,16 +405,18 @@ struct CategoryButtonsView: View {
|
||||
AppState.shared.setAppStep(step: .blockList)
|
||||
}
|
||||
|
||||
CategoryButtonItem(
|
||||
icon: "ic_my_coupon",
|
||||
title: I18n.MyPage.Category.couponRegister
|
||||
) {
|
||||
if isAuthenticated {
|
||||
AppState.shared.setAppStep(step: .canCoupon(refresh: refresh))
|
||||
} else {
|
||||
showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
isShowAuthView = true
|
||||
if shouldShowCouponRegister {
|
||||
CategoryButtonItem(
|
||||
icon: "ic_my_coupon",
|
||||
title: I18n.MyPage.Category.couponRegister
|
||||
) {
|
||||
if isAuthenticated || !isKoreanCountry {
|
||||
AppState.shared.setAppStep(step: .canCoupon(refresh: refresh))
|
||||
} else {
|
||||
showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
isShowAuthView = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user