Skip to content

Commit

Permalink
[#111] 계정탈퇴 시 탈퇴완료뷰 뜰 수 있도록 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Guryss committed Nov 5, 2024
1 parent 8cddba0 commit 79ae433
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
36 changes: 19 additions & 17 deletions AGAMI/Sources/Presentation/View/Account/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,32 @@ struct AccountView: View {

LogoutButton(viewModel: viewModel)
.padding(.bottom, 20)

if viewModel.isScucessDeleteAccount {
SignOutView()
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
viewModel.isScucessDeleteAccount = false
UserDefaults.standard.removeObject(forKey: "isSignedIn")
}
}
}
}
.padding(.horizontal, 8)

if viewModel.isScucessDeleteAccount {
SignOutView()
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
viewModel.isScucessDeleteAccount = false
UserDefaults.standard.removeObject(forKey: "isSignedIn")
}
}
}
}
.navigationTitle("계정")
.navigationBarTitleDisplayMode(.large)
.navigationBarBackButtonHidden()
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button {
coordinator.pop()
} label: {
Image(systemName: "chevron.backward")
.font(.pretendard(weight: .semiBold600, size: 17))
.foregroundStyle(Color(.pPrimary))
if !viewModel.isScucessDeleteAccount {
ToolbarItem(placement: .topBarLeading) {
Button {
coordinator.pop()
} label: {
Image(systemName: "chevron.backward")
.font(.pretendard(weight: .semiBold600, size: 17))
.foregroundStyle(Color(.pPrimary))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ final class AccountViewModel {

if success {
isScucessDeleteAccount = true
UserDefaults.standard.removeObject(forKey: "isSignedIn")
dump("계정 삭제 성공")
} else {
dump("계정 삭제 실패")
Expand Down

0 comments on commit 79ae433

Please sign in to comment.