인증 완료 후 동작 실행

This commit is contained in:
Yu Sung
2026-01-14 11:31:08 +09:00
parent 1b583eabba
commit 4354530372
3 changed files with 29 additions and 15 deletions

View File

@@ -14,6 +14,8 @@ struct ChatTabView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("auth") private var auth: Bool = UserDefaults.bool(forKey: UserDefaultsKey.auth)
@StateObject var mypageViewModel = MyPageViewModel()
private enum InnerTab: Int, CaseIterable {
case character = 0
case original = 1
@@ -153,12 +155,15 @@ struct ChatTabView: View {
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone { _ in
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
.onDone {
DEBUG_LOG("onDone: \($0)")
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
}
}
.onClose {