Skip to content

Commit 526dd62

Browse files
committed
Refactor: isAuthenticated 값에 따른 화면 전환
1 parent c55dc33 commit 526dd62

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

Projects/Presentation/Sources/Common/Extension/UIViewController+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension UIViewController {
3131

3232
case .withPrograssBarWithoutBackButton(let step, let stepCount):
3333
navigationController?.setNavigationBarHidden(false, animated: false)
34-
navigationController?.navigationItem.setHidesBackButton(true, animated: false)
34+
navigationItem.setHidesBackButton(true, animated: false)
3535
configureProgressNavigationBar(step: step, stepCount: stepCount)
3636
}
3737
}

Projects/Presentation/Sources/Setting/View/SettingView.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,18 @@ final class SettingView: BaseViewController<SettingViewModel> {
202202
viewModel.output.isAuthenticatedPublisher
203203
.receive(on: DispatchQueue.main)
204204
.sink(receiveValue: { isAuthenticated in
205-
guard
206-
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
207-
let sceneDelegate = windowScene.delegate as? UIWindowSceneDelegate,
208-
let window = sceneDelegate.window
209-
else { return }
210-
211-
let introView = IntroView()
212-
let navigationController = UINavigationController(rootViewController: introView)
213-
window?.rootViewController = navigationController
214-
window?.makeKeyAndVisible()
205+
if !isAuthenticated {
206+
guard
207+
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
208+
let sceneDelegate = windowScene.delegate as? UIWindowSceneDelegate,
209+
let window = sceneDelegate.window
210+
else { return }
211+
212+
let introView = IntroView()
213+
let navigationController = UINavigationController(rootViewController: introView)
214+
window?.rootViewController = navigationController
215+
window?.makeKeyAndVisible()
216+
}
215217
})
216218
.store(in: &cancellables)
217219
}

0 commit comments

Comments
 (0)