diff --git a/SodaLive/Resources/Localizable.xcstrings b/SodaLive/Resources/Localizable.xcstrings index 82a5f69..8bbf2ef 100644 --- a/SodaLive/Resources/Localizable.xcstrings +++ b/SodaLive/Resources/Localizable.xcstrings @@ -753,6 +753,22 @@ } } }, + "%@ 님의 시리즈 전체보기" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "View all series by %@" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ さんのシリーズをすべて見る" + } + } + } + }, "%@ 연재" : { "localizations" : { "en" : { @@ -4049,22 +4065,6 @@ } } }, - "모집완료" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Recruitment closed" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "募集終了" - } - } - } - }, "모집중" : { "localizations" : { "en" : { @@ -4097,7 +4097,24 @@ } } }, + "모집완료" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Recruitment closed" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "募集終了" + } + } + } + }, "목소리로 만나는 새로운 세계" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -5138,6 +5155,7 @@ } }, "소다라이브" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -5425,6 +5443,38 @@ } } }, + "시리즈 전체보기" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "View all series" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "シリーズをすべて見る" + } + } + } + }, + "시스템 기본" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "System default" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "システムのデフォルト" + } + } + } + }, "시작 시간" : { "localizations" : { "en" : { @@ -5649,6 +5699,22 @@ } } }, + "언어 설정" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Language settings" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "言語設定" + } + } + } + }, "여성향" : { "localizations" : { "en" : { @@ -7425,6 +7491,22 @@ } } }, + "적용" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Apply" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "適用" + } + } + } + }, "전체" : { "localizations" : { "en" : { @@ -9600,38 +9682,6 @@ } } } - }, - "시리즈 전체보기" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "View all series" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "シリーズをすべて見る" - } - } - } - }, - "%@ 님의 시리즈 전체보기" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "View all series by %@" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "%@ さんのシリーズをすべて見る" - } - } - } } }, "version" : "1.1" diff --git a/SodaLive/Sources/App/AppState.swift b/SodaLive/Sources/App/AppState.swift index c8d970a..ab08d2a 100644 --- a/SodaLive/Sources/App/AppState.swift +++ b/SodaLive/Sources/App/AppState.swift @@ -43,7 +43,7 @@ class AppState: ObservableObject { @Published var purchasedContentId = 0 @Published var purchasedContentOrderType = OrderType.KEEP - @Published var isChangeAdultContentVisible = false + @Published var isRestartApp = false @Published var startTab: HomeViewModel.CurrentTab = .home @Published var marketingUtmSource = "" @@ -74,4 +74,13 @@ class AppState: ObservableObject { self.appStep = .main } } + + // 언어 적용 직후 앱을 소프트 재시작(스플래시 -> 메인)하여 전역 UI를 새로고침 + func softRestart() { + isRestartApp = true + setAppStep(step: .splash) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + self.setAppStep(step: .main) + } + } } diff --git a/SodaLive/Sources/App/AppStep.swift b/SodaLive/Sources/App/AppStep.swift index 16bc3ec..8dc53c6 100644 --- a/SodaLive/Sources/App/AppStep.swift +++ b/SodaLive/Sources/App/AppStep.swift @@ -26,6 +26,8 @@ enum AppStep { case settings + case languageSettings + case notices case noticeDetail(notice: NoticeItem) diff --git a/SodaLive/Sources/App/SodaLiveApp.swift b/SodaLive/Sources/App/SodaLiveApp.swift index 9376485..36f1ce4 100644 --- a/SodaLive/Sources/App/SodaLiveApp.swift +++ b/SodaLive/Sources/App/SodaLiveApp.swift @@ -19,9 +19,12 @@ struct SodaLiveApp: App { @ObservedObject var viewModel = AppViewModel() @StateObject var canPgPaymentViewModel = CanPgPaymentViewModel() + @StateObject private var languageEnvironment = LanguageContainer.environment init() { configureImageCache() + // 앱 시작 직후, 초기 네트워크 요청도 올바른 언어 헤더를 갖도록 동기 초기화 + LanguageHeaderProvider.initialize() } private func configureImageCache() { @@ -40,6 +43,10 @@ struct SodaLiveApp: App { var body: some Scene { WindowGroup { ContentView(canPgPaymentViewModel: canPgPaymentViewModel) + .environment(\.locale, languageEnvironment.locale) + .task { + await LanguageContainer.service.bootstrap() + } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in CreatorCommunityMediaPlayerManager.shared.pauseContent() // 백그라운드 전환 시 메모리 캐시 정리 diff --git a/SodaLive/Sources/ContentView.swift b/SodaLive/Sources/ContentView.swift index 82121a5..cc058a7 100644 --- a/SodaLive/Sources/ContentView.swift +++ b/SodaLive/Sources/ContentView.swift @@ -18,7 +18,7 @@ struct ContentView: View { ZStack { Color.black.ignoresSafeArea() - if appState.isChangeAdultContentVisible { + if appState.isRestartApp { EmptyView() } else { HomeView() @@ -48,6 +48,9 @@ struct ContentView: View { case .settings: SettingsView() + + case .languageSettings: + LanguageSettingsView() case .notices: NoticeListView() diff --git a/SodaLive/Sources/Extensions/AcceptLanguageDebugLogger.swift b/SodaLive/Sources/Extensions/AcceptLanguageDebugLogger.swift new file mode 100644 index 0000000..b3c82eb --- /dev/null +++ b/SodaLive/Sources/Extensions/AcceptLanguageDebugLogger.swift @@ -0,0 +1,19 @@ +// +// AcceptLanguageDebugLogger.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +#if DEBUG +import Foundation +import Moya + +/// 디버그용: 각 요청 직전에 Accept-Language 헤더를 콘솔에 출력합니다. +struct AcceptLanguageDebugLogger: PluginType { + func willSend(_ request: RequestType, target: TargetType) { + let header = request.request?.allHTTPHeaderFields?["Accept-Language"] ?? "" + DEBUG_LOG("[Network] Accept-Language: \(header)") + } +} +#endif diff --git a/SodaLive/Sources/Extensions/MoyaProviderExtension.swift b/SodaLive/Sources/Extensions/MoyaProviderExtension.swift index 6ab53cc..8503220 100644 --- a/SodaLive/Sources/Extensions/MoyaProviderExtension.swift +++ b/SodaLive/Sources/Extensions/MoyaProviderExtension.swift @@ -10,7 +10,15 @@ import Foundation extension MoyaProvider { convenience init() { - self.init(plugins: [AuthPlugin()]) + var plugins: [PluginType] = [ + AuthPlugin(), + AcceptLanguagePlugin() + ] + #if DEBUG + plugins.append(NetworkLoggerPlugin(configuration: .init(logOptions: [.requestHeaders]))) + plugins.append(AcceptLanguageDebugLogger()) + #endif + self.init(plugins: plugins) } } diff --git a/SodaLive/Sources/MyPage/MyPageViewModel.swift b/SodaLive/Sources/MyPage/MyPageViewModel.swift index 909f7d3..64b8377 100644 --- a/SodaLive/Sources/MyPage/MyPageViewModel.swift +++ b/SodaLive/Sources/MyPage/MyPageViewModel.swift @@ -102,7 +102,7 @@ final class MyPageViewModel: ObservableObject { } else { UserDefaults.set(ContentType.MALE.rawValue, forKey: .contentPreference) } - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } else { if let message = decoded.message { diff --git a/SodaLive/Sources/Settings/Content/ContentSettingsView.swift b/SodaLive/Sources/Settings/Content/ContentSettingsView.swift index 9ea9e7d..f1ee992 100644 --- a/SodaLive/Sources/Settings/Content/ContentSettingsView.swift +++ b/SodaLive/Sources/Settings/Content/ContentSettingsView.swift @@ -17,7 +17,7 @@ struct ContentSettingsView: View { VStack(spacing: 0) { DetailNavigationBar(title: "콘텐츠 보기 설정") { - if AppState.shared.isChangeAdultContentVisible { + if AppState.shared.isRestartApp { AppState.shared.setAppStep(step: .splash) } else { AppState.shared.back() diff --git a/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift b/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift index 9c11091..765e931 100644 --- a/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift +++ b/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift @@ -12,7 +12,7 @@ final class ContentSettingsViewModel: ObservableObject { didSet { if oldValue != isAdultContentVisible { UserDefaults.set(isAdultContentVisible, forKey: .isAdultContentVisible) - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true if !isAdultContentVisible { adultContentPreference = .ALL @@ -26,7 +26,7 @@ final class ContentSettingsViewModel: ObservableObject { didSet { if oldValue != adultContentPreference { UserDefaults.set(adultContentPreference.rawValue, forKey: .contentPreference) - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true } } } diff --git a/SodaLive/Sources/Settings/Language/Models/LanguageOption.swift b/SodaLive/Sources/Settings/Language/Models/LanguageOption.swift new file mode 100644 index 0000000..d5c6f8a --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Models/LanguageOption.swift @@ -0,0 +1,26 @@ +// +// LanguageOption.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation + +enum LanguageOption: String, CaseIterable, Equatable { + case system + case ko + case en + case ja + + var displayName: String { + switch self { + case .system: return String(localized: "시스템 기본") + case .ko: return "한국어" + case .en: return "English" + case .ja: return "日本語" + } + } + + var headerCode: String? { self == .system ? nil : self.rawValue } +} diff --git a/SodaLive/Sources/Settings/Language/Repository/LanguageRepository.swift b/SodaLive/Sources/Settings/Language/Repository/LanguageRepository.swift new file mode 100644 index 0000000..ed141a9 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Repository/LanguageRepository.swift @@ -0,0 +1,33 @@ +// +// LanguageRepository.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation + +protocol LanguageRepository { + func load() async throws -> LanguageOption? + func save(_ option: LanguageOption) async throws +} + +final class UserDefaultsLanguageRepository: LanguageRepository { + private let key = "app.language" + + func load() async throws -> LanguageOption? { + try Task.checkCancellation() + return await withCheckedContinuation { cont in + let value = UserDefaults.standard.string(forKey: key) + cont.resume(returning: value.flatMap { LanguageOption(rawValue: $0) }) + } + } + + func save(_ option: LanguageOption) async throws { + try Task.checkCancellation() + return await withCheckedContinuation { cont in + UserDefaults.standard.set(option.rawValue, forKey: key) + cont.resume() + } + } +} diff --git a/SodaLive/Sources/Settings/Language/Services/AcceptLanguagePlugin.swift b/SodaLive/Sources/Settings/Language/Services/AcceptLanguagePlugin.swift new file mode 100644 index 0000000..150d952 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Services/AcceptLanguagePlugin.swift @@ -0,0 +1,18 @@ +// +// AcceptLanguagePlugin.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation +import Moya + +struct AcceptLanguagePlugin: PluginType { + func prepare(_ request: URLRequest, target: TargetType) -> URLRequest { + var req = request + let code = LanguageHeaderProvider.current + req.setValue(code, forHTTPHeaderField: "Accept-Language") + return req + } +} diff --git a/SodaLive/Sources/Settings/Language/Services/LanguageEnvironment.swift b/SodaLive/Sources/Settings/Language/Services/LanguageEnvironment.swift new file mode 100644 index 0000000..06dd090 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Services/LanguageEnvironment.swift @@ -0,0 +1,12 @@ +// +// LanguageEnvironment.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation + +final class LanguageEnvironment: ObservableObject { + @Published var locale: Locale = .current +} diff --git a/SodaLive/Sources/Settings/Language/Services/LanguageService.swift b/SodaLive/Sources/Settings/Language/Services/LanguageService.swift new file mode 100644 index 0000000..c94d730 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Services/LanguageService.swift @@ -0,0 +1,108 @@ +// +// LanguageService.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation + +enum LanguageHeaderProvider { + private static let defaultsKey = "app.language" + + // 현재 헤더 코드(ko|en|ja). 앱 시작 시 initialize()로 동기 설정. + static var current: String = { + // 초기값은 OS 선호 기반으로 계산 + return mapPreferredToSupported(Locale.preferredLanguages.first) + }() + + /// 앱 시작 직후 동기 초기화: 저장된 설정이 있으면 그 값을, 없으면 OS 선호를 사용. + static func initialize() { + if let raw = UserDefaults.standard.string(forKey: defaultsKey), + let option = LanguageOption(rawValue: raw), + option != .system { + // 명시 선택 값 + current = option.rawValue + return + } + // 시스템 기본 또는 저장값 없음 → OS 선호 매핑 + current = mapPreferredToSupported(Locale.preferredLanguages.first) + } + + private static func mapPreferredToSupported(_ tag: String?) -> String { + guard let tag = tag else { return "en" } + if tag.hasPrefix("ko") { return "ko" } + if tag.hasPrefix("ja") { return "ja" } + return "en" + } +} + +actor LanguageService { + private let repository: LanguageRepository + private let environment: LanguageEnvironment + + init(repository: LanguageRepository, environment: LanguageEnvironment) { + self.repository = repository + self.environment = environment + } + + func bootstrap() async { + let saved = (try? await repository.load()) ?? .system + await applyLanguage(saved) + } + + func applyLanguage(_ option: LanguageOption) async { + do { try await repository.save(option) } catch { DEBUG_LOG("[Language] save failed: \(error)") } + let locale = resolveLocale(option) + let header = resolveHeader(option, locale: locale) + LanguageHeaderProvider.current = header + await MainActor.run { [weak environment] in + environment?.locale = locale + } + DEBUG_LOG("[Language] changed to option=\(option.rawValue) locale=\(locale.identifier) header=\(header)") + } + + func currentLocale() async -> Locale { + await MainActor.run { environment.locale } + } + + func currentLanguageCodeForHeader() async -> String { LanguageHeaderProvider.current } + + // MARK: - Private + private func resolveLocale(_ option: LanguageOption) -> Locale { + switch option { + case .system: + guard let first = Locale.preferredLanguages.first else { return Locale(identifier: "en_US") } + return mapToSupported(first) + case .ko: return Locale(identifier: "ko_KR") + case .en: return Locale(identifier: "en_US") + case .ja: return Locale(identifier: "ja_JP") + } + } + + private func resolveHeader(_ option: LanguageOption, locale: Locale) -> String { + switch option { + case .system: + let id = locale.identifier + if id.hasPrefix("ko") { return "ko" } + if id.hasPrefix("ja") { return "ja" } + return "en" + case .ko: return "ko" + case .en: return "en" + case .ja: return "ja" + } + } + + private func mapToSupported(_ tag: String) -> Locale { + if tag.hasPrefix("ko") { return .init(identifier: "ko_KR") } + if tag.hasPrefix("ja") { return .init(identifier: "ja_JP") } + return .init(identifier: "en_US") + } +} + +// Composition root for language feature +enum LanguageContainer { + static let environment = LanguageEnvironment() + static let repository: LanguageRepository = UserDefaultsLanguageRepository() + static let service = LanguageService(repository: repository, environment: environment) +} diff --git a/SodaLive/Sources/Settings/Language/ViewModels/LanguageSettingsViewModel.swift b/SodaLive/Sources/Settings/Language/ViewModels/LanguageSettingsViewModel.swift new file mode 100644 index 0000000..23ddc59 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/ViewModels/LanguageSettingsViewModel.swift @@ -0,0 +1,58 @@ +// +// LanguageSettingsViewModel.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import Foundation + +final class LanguageSettingsViewModel: ObservableObject { + // 저장된(현재 적용된) 언어 + @Published var selected: LanguageOption = .system + // 사용자가 화면에서 선택 중인 언어(적용 버튼 누르기 전 임시 상태) + @Published var pending: LanguageOption = .system + + private let service: LanguageService + + init(service: LanguageService = LanguageContainer.service) { + self.service = service + } + + func onAppear() { + Task { await loadCurrent() } + } + + private func loadCurrent() async { + let locale = await service.currentLocale() + let option = map(locale: locale) + await MainActor.run { + self.selected = option + self.pending = option + } + } + + func select(_ option: LanguageOption) { + // 즉시 저장/적용하지 않고, 사용자가 '적용' 버튼을 누를 때까지 대기 + self.pending = option + } + + /// 선택한 언어를 저장/적용하고, 앱을 소프트 재시작하여 즉시 반영 + func applyAndRestart() async { + let toApply = pending + await service.applyLanguage(toApply) + await MainActor.run { + self.selected = toApply + // 앱 소프트 재시작(스플래시 -> 메인) + AppState.shared.softRestart() + } + } + + private func map(locale: Locale) -> LanguageOption { + let id = locale.identifier + if id.hasPrefix("ko") { return .ko } + if id.hasPrefix("ja") { return .ja } + if id.hasPrefix("en") { return .en } + return .system + } +} diff --git a/SodaLive/Sources/Settings/Language/Views/LanguageSettingsView.swift b/SodaLive/Sources/Settings/Language/Views/LanguageSettingsView.swift new file mode 100644 index 0000000..86dcc33 --- /dev/null +++ b/SodaLive/Sources/Settings/Language/Views/LanguageSettingsView.swift @@ -0,0 +1,76 @@ +// +// LanguageSettingsView.swift +// SodaLive +// +// Created by Junie (AI) on 2025/12/16. +// + +import SwiftUI + +struct LanguageSettingsView: View { + @StateObject private var viewModel = LanguageSettingsViewModel() + + var body: some View { + let cardWidth = screenSize().width - 26.7 + + ZStack { + Color.black.ignoresSafeArea() + + VStack(spacing: 0) { + DetailNavigationBar(title: String(localized: "언어 설정")) + + ScrollView(.vertical, showsIndicators: false) { + VStack(spacing: 0) { + // List를 ScrollView 안에 두면 렌더링 이슈가 발생할 수 있어 + // 기본 체크마크(SF Symbols)로 커스텀 라디오 UI를 구성합니다. + VStack(spacing: 0) { + ForEach(Array(LanguageOption.allCases.enumerated()), id: \.offset) { idx, option in + HStack(spacing: 0) { + Text(option.displayName) + .font(.custom(Font.preRegular.rawValue, size: 16)) + .foregroundColor(Color.grayee) + Spacer() + if viewModel.pending == option { + Image(systemName: "checkmark") + .font(.system(size: 16, weight: .semibold)) + .foregroundColor(Color.white) + } + } + .padding(.horizontal, 16.7) + .frame(height: 50) + .contentShape(Rectangle()) + .onTapGesture { viewModel.select(option) } + + if idx < LanguageOption.allCases.count - 1 { + Rectangle() + .frame(height: 0.3) + .foregroundColor(Color.gray90) + .padding(.leading, 16.7) + } + } + } + .frame(width: cardWidth) + .background(Color.gray22) + .cornerRadius(6.7) + .padding(.top, 26.7) + + // 적용 버튼 + Button(action: { + Task { await viewModel.applyAndRestart() } + }) { + Text(String(localized: "적용")) + .font(.custom(Font.preBold.rawValue, size: 16)) + .frame(width: cardWidth, height: 50) + .background(Color.button) + .cornerRadius(6.7) + .foregroundColor(.white) + } + .padding(.top, 20) + .padding(.bottom, 26.7) + } + } + } + .task { viewModel.onAppear() } + } + } +} diff --git a/SodaLive/Sources/Settings/SettingsView.swift b/SodaLive/Sources/Settings/SettingsView.swift index 4f15f78..c89ec38 100644 --- a/SodaLive/Sources/Settings/SettingsView.swift +++ b/SodaLive/Sources/Settings/SettingsView.swift @@ -43,6 +43,28 @@ struct SettingsView: View { AppState.shared.setAppStep(step: .notificationSettings) } + Rectangle() + .frame(width: cardWidth - 26.7, height: 0.3) + .foregroundColor(Color.gray90) + + HStack(spacing: 0) { + Text("언어 설정") + .font(.custom(Font.bold.rawValue, size: 14.7)) + .foregroundColor(Color.grayee) + + Spacer() + + Image("ic_forward") + .resizable() + .frame(width: 20, height: 20) + } + .padding(.horizontal, 3.3) + .frame(width: cardWidth - 26.7, height: 50) + .contentShape(Rectangle()) + .onTapGesture { + AppState.shared.setAppStep(step: .languageSettings) + } + if UserDefaults.bool(forKey: .auth) { Rectangle() .frame(width: cardWidth - 26.7, height: 0.3) @@ -205,7 +227,7 @@ struct SettingsView: View { UserDefaults.reset() recentContentViewModel.truncate() - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } }, @@ -227,7 +249,7 @@ struct SettingsView: View { viewModel.logoutAllDevice { self.isShowLogoutAllDeviceDialog = false UserDefaults.reset() - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } }, diff --git a/SodaLive/Sources/Settings/SignOut/SignOutViewModel.swift b/SodaLive/Sources/Settings/SignOut/SignOutViewModel.swift index 1ce6f5b..55a0354 100644 --- a/SodaLive/Sources/Settings/SignOut/SignOutViewModel.swift +++ b/SodaLive/Sources/Settings/SignOut/SignOutViewModel.swift @@ -56,7 +56,7 @@ final class SignOutViewModel: ObservableObject { if decoded.success { UserDefaults.reset() - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } else { if let message = decoded.message { diff --git a/SodaLive/Sources/Splash/SplashView.swift b/SodaLive/Sources/Splash/SplashView.swift index 33b5a8b..9b26882 100644 --- a/SodaLive/Sources/Splash/SplashView.swift +++ b/SodaLive/Sources/Splash/SplashView.swift @@ -64,7 +64,7 @@ struct SplashView: View { } .onAppear { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { - AppState.shared.isChangeAdultContentVisible = false + AppState.shared.isRestartApp = false } fetchLastestVersion() } diff --git a/SodaLive/Sources/User/Login/LoginViewModel.swift b/SodaLive/Sources/User/Login/LoginViewModel.swift index 0d0786a..512ebe3 100644 --- a/SodaLive/Sources/User/Login/LoginViewModel.swift +++ b/SodaLive/Sources/User/Login/LoginViewModel.swift @@ -57,7 +57,7 @@ final class LoginViewModel: ObservableObject { UserDefaults.set(data.email, forKey: .email) UserDefaults.set(data.token, forKey: .token) self.appViewModel.fetchAndUpdateIdfa() - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } else { if let message = decoded.message { diff --git a/SodaLive/Sources/User/SignUp/SignUpViewModel.swift b/SodaLive/Sources/User/SignUp/SignUpViewModel.swift index 98d9a6a..5933edf 100644 --- a/SodaLive/Sources/User/SignUp/SignUpViewModel.swift +++ b/SodaLive/Sources/User/SignUp/SignUpViewModel.swift @@ -61,7 +61,7 @@ final class SignUpViewModel: ObservableObject { UserDefaults.set(data.email, forKey: .email) UserDefaults.set(data.token, forKey: .token) self.appViewModel.fetchAndUpdateIdfa() - AppState.shared.isChangeAdultContentVisible = true + AppState.shared.isRestartApp = true AppState.shared.setAppStep(step: .splash) } else { if let message = decoded.message {