점검중 플래그, 팝업 추가

This commit is contained in:
Yu Sung 2024-11-21 01:05:33 +09:00
parent c1a4c534e1
commit d2d44d5e9d
1 changed files with 16 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import FirebaseRemoteConfig
struct SplashView: View {
@State private var isShowForcedUpdatePopup = false
@State private var isShowUpdatePopup = false
@State private var isShowMaintenancePopup = false
@StateObject var liveViewModel = LiveViewModel()
@ -31,6 +32,15 @@ struct SplashView: View {
.padding(.bottom, screenSize().height * 240 / 2337)
}
if isShowMaintenancePopup {
SodaDialog(
title: "안내",
desc: "서비스 점검중입니다.",
confirmButtonTitle: "확인",
confirmButtonAction: { isShowMaintenancePopup = false }
)
}
if isShowUpdatePopup {
SodaDialog(
title: "업데이트",
@ -76,7 +86,12 @@ struct SplashView: View {
remoteConfig.fetch { status, error in
if status == .success {
remoteConfig.activate { changed, error in
checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue)
let isMaintenance = remoteConfig["is_maintenance"].boolValue
if isMaintenance {
isShowMaintenancePopup = true
} else {
checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue)
}
}
} else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {