fix(content): 성인 콘텐츠 설정 동기화와 국가별 인증 분기를 적용한다
This commit is contained in:
@@ -64,7 +64,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
@Published var isShowUserProfilePopup = false
|
||||
@Published var changeIsAdult = false {
|
||||
didSet {
|
||||
if changeIsAdult && !UserDefaults.bool(forKey: .auth) {
|
||||
if changeIsAdult && requiresAdultAuthenticationByCountry() {
|
||||
agora.speakerMute(true)
|
||||
}
|
||||
}
|
||||
@@ -653,7 +653,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
getTotalDonationCan()
|
||||
getTotalHeartCount()
|
||||
|
||||
if data.isAdult && !UserDefaults.bool(forKey: .auth) {
|
||||
if data.isAdult && requiresAdultAuthenticationByCountry() {
|
||||
changeIsAdult = true
|
||||
}
|
||||
|
||||
@@ -697,6 +697,16 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
private func requiresAdultAuthenticationByCountry() -> Bool {
|
||||
let normalizedCountryCode = UserDefaults
|
||||
.string(forKey: .countryCode)
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.uppercased()
|
||||
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
||||
|
||||
return isKoreanCountry && !UserDefaults.bool(forKey: .auth)
|
||||
}
|
||||
|
||||
func toggleMute() {
|
||||
setMute(!isMute)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user