Skip to content

Commit 5fe8503

Browse files
committedFeb 25, 2025
refactor/#408 재동작 코드 수정
1 parent 87dcad9 commit 5fe8503

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎KkuMulKum/Application/SceneDelegate.swift

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
5858
}
5959

6060
performAutoLogin()
61+
62+
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
63+
print("🧪 Testing navigation pulse manually")
64+
self.loginViewModel.navigationPulse.emit(.toMain)
65+
}
6166
}
6267

6368

‎KkuMulKum/Source/Onboarding/Login/VIewModel/LoginViewModel.swift

+11
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class LoginViewModel: NSObject {
168168
}
169169

170170
private func handleLoginResponse(_ response: ResponseBodyDTO<SocialLoginResponseModel>) {
171+
print("Handling login response")
171172
if response.success, let data = response.data {
172173
saveTokens(
173174
accessToken: data.jwtTokenDTO.accessToken,
@@ -180,11 +181,21 @@ class LoginViewModel: NSObject {
180181
navigationPulse.reset()
181182

182183
if data.name != nil {
184+
print("Login successful, user has a name")
183185
loginState = .login
186+
print("🚀 Emitting navigation pulse to main")
184187
navigationPulse.emit(.toMain)
185188

189+
// 디버깅용: 직접 화면 전환
190+
DispatchQueue.main.async {
191+
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
192+
let sceneDelegate = windowScene?.delegate as? SceneDelegate
193+
sceneDelegate?.showMainScreen()
194+
}
186195
} else {
196+
print("Login successful, but user needs onboarding")
187197
loginState = .needOnboarding
198+
print("🚀 Emitting navigation pulse to onboarding")
188199
navigationPulse.emit(.toOnboarding)
189200
}
190201
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.