fix(content): 성인 콘텐츠 설정 동기화와 국가별 인증 분기를 적용한다
This commit is contained in:
@@ -21,6 +21,12 @@ struct MyPageView: View {
|
||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||
|
||||
var body: some View {
|
||||
let normalizedCountryCode = UserDefaults
|
||||
.string(forKey: .countryCode)
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.uppercased()
|
||||
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
||||
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty &&
|
||||
viewModel.isShowAuthView {
|
||||
@@ -114,6 +120,7 @@ struct MyPageView: View {
|
||||
CategoryButtonsView(
|
||||
isShowAuthView: $viewModel.isShowAuthView,
|
||||
isAuthenticated: viewModel.isAuth,
|
||||
isKoreanCountry: isKoreanCountry,
|
||||
showMessage: {
|
||||
viewModel.errorMessage = $0
|
||||
viewModel.isShowPopup = true
|
||||
@@ -381,6 +388,7 @@ struct CategoryButtonsView: View {
|
||||
@Binding var isShowAuthView: Bool
|
||||
|
||||
let isAuthenticated: Bool
|
||||
let isKoreanCountry: Bool
|
||||
let showMessage: (String) -> Void
|
||||
let refresh: () -> Void
|
||||
|
||||
@@ -420,12 +428,14 @@ struct CategoryButtonsView: View {
|
||||
AppState.shared.setAppStep(step: .serviceCenter)
|
||||
}
|
||||
|
||||
CategoryButtonItem(
|
||||
icon: "ic_my_auth",
|
||||
title: isAuthenticated ? "인증완료" : "본인인증"
|
||||
) {
|
||||
if !isAuthenticated {
|
||||
isShowAuthView = true
|
||||
if isKoreanCountry {
|
||||
CategoryButtonItem(
|
||||
icon: "ic_my_auth",
|
||||
title: isAuthenticated ? "인증완료" : "본인인증"
|
||||
) {
|
||||
if !isAuthenticated {
|
||||
isShowAuthView = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user