Skip to content

Commit 56eafd8

Browse files
committed
Fixed login flow issue in debug mode
1 parent 15656f8 commit 56eafd8

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

GoInfoGame/GoInfoGame/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
6969
DispatchQueue.main.async {
7070
Utilities.clearAllData()
7171
if let window = UIApplication.window() {
72-
window.rootViewController = UIHostingController(rootView: PosmLoginView())
72+
window.rootViewController = UIHostingController(rootView: PosmLoginView(forceUpdateManager: ForceUpdateManager()))
7373
}
7474
}
7575
}

GoInfoGame/GoInfoGame/Login/View/PosmLogin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct PosmLoginView: View {
2222
@State private var showDisableDebugModeAlert: Bool = false
2323
let forceUpdateManager: ForceUpdateManager?
2424

25-
init(forceUpdateManager: ForceUpdateManager? = nil) {
25+
init(forceUpdateManager: ForceUpdateManager?) {
2626
self.forceUpdateManager = forceUpdateManager
2727
APIConfiguration.shared.environment = .production
2828
}
@@ -233,5 +233,5 @@ struct PosmLoginView: View {
233233
}
234234

235235
#Preview {
236-
PosmLoginView()
236+
PosmLoginView(forceUpdateManager: nil)
237237
}

GoInfoGame/GoInfoGame/Network/APIHandler/NetworkManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class NetworkManager: NetworkHandler {
131131
DispatchQueue.main.async {
132132
if let window = UIApplication.window() {
133133
Utilities.clearAllData()
134-
window.rootViewController = UIHostingController(rootView: PosmLoginView())
134+
window.rootViewController = UIHostingController(rootView: PosmLoginView(forceUpdateManager: ForceUpdateManager()))
135135
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
136136
NotificationCenter.default.post(name: Notification.Name("SessionExpired"), object: nil)
137137
}

GoInfoGame/GoInfoGame/Network/ApiManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ApiManager {
164164
DispatchQueue.main.async {
165165
if let window = UIApplication.window() {
166166
Utilities.clearAllData()
167-
window.rootViewController = UIHostingController(rootView: PosmLoginView())
167+
window.rootViewController = UIHostingController(rootView: PosmLoginView(forceUpdateManager: ForceUpdateManager()))
168168
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
169169
NotificationCenter.default.post(name: Notification.Name("SessionExpired"), object: nil)
170170
}

GoInfoGame/GoInfoGame/UI/InitialView/InitialViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ import Foundation
99
import SwiftUI
1010
class InitialViewController: UIHostingController<PosmLoginView> {
1111
required init?(coder aDecoder: NSCoder) {
12-
super.init(coder: aDecoder, rootView: PosmLoginView())
12+
super.init(coder: aDecoder, rootView: PosmLoginView(forceUpdateManager: ForceUpdateManager()))
1313
}
1414
}

GoInfoGame/GoInfoGame/UserProfile/View/UserProfileView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct UserProfileView: View {
148148
Utilities.clearAllData()
149149

150150
if let window = UIApplication.window() {
151-
window.rootViewController = UIHostingController(rootView: PosmLoginView())
151+
window.rootViewController = UIHostingController(rootView: PosmLoginView(forceUpdateManager: ForceUpdateManager()))
152152
}
153153
// accessToken = nil
154154
} label: {

0 commit comments

Comments
 (0)