From 78f88908df2257131ae06242519ac61942a9353c Mon Sep 17 00:00:00 2001 From: Byeonjinha Date: Tue, 5 Dec 2023 00:08:56 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9B[chore]:=20=ED=8C=9D=EC=97=85?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ViewModel/AuthorizationViewModel.swift | 14 ++++---------- .../Sources/ViewModel/CommonViewViewModel.swift | 8 ++------ .../Core/Sources/UI/View/TabView/CoreView.swift | 11 ++--------- .../Sources/UI/View/MainView/LoginView.swift | 3 --- .../Sources/ViewModel/OnBoardingViewModel.swift | 2 -- .../Sources/UI/View/WithDraw/WithDrawView.swift | 1 - 6 files changed, 8 insertions(+), 31 deletions(-) diff --git a/PingPong/Projects/Core/Authorization/Sources/ViewModel/AuthorizationViewModel.swift b/PingPong/Projects/Core/Authorization/Sources/ViewModel/AuthorizationViewModel.swift index 70315cfa..471659b2 100644 --- a/PingPong/Projects/Core/Authorization/Sources/ViewModel/AuthorizationViewModel.swift +++ b/PingPong/Projects/Core/Authorization/Sources/ViewModel/AuthorizationViewModel.swift @@ -37,18 +37,15 @@ public class AuthorizationViewModel: ObservableObject { } } + @AppStorage("deleteAuth") public var deleteAuth : Bool = false - - @Published public var isDeletAuth: Bool = false - @AppStorage("deleteAuth") public var deleteAuth : Bool = false { + @Published public var loginStatus: Bool = false + @Published var deleteUser: Bool = false { didSet { - self.isDeletAuth = deleteAuth + print("\(deleteUser) 바뀌었어") } } - @Published public var loginStatus: Bool = false - @Published var deleteUser: Bool = false - var userNickNameCheckCancellable: AnyCancellable? @Published var userNickNameModel: NickNameValidateModel? @@ -74,8 +71,6 @@ public class AuthorizationViewModel: ObservableObject { uid = UserDefaults.standard.string(forKey: "Uid") ?? "" userid = UserDefaults.standard.integer(forKey: "userId") userUid = UserDefaults.standard.string(forKey: "userUid") ?? "" - isNotification = UserDefaults.standard.bool(forKey: "isNotification") - deleteAuth = UserDefaults.standard.bool(forKey: "deleteAuth") randomAuthNickName = UserDefaults.standard.string(forKey: "randomNickName") ?? "" } @@ -99,7 +94,6 @@ public class AuthorizationViewModel: ObservableObject { let firebaseAuth = Auth.auth() firebaseAuth.currentUser?.delete(completion: { error in - self.deleteUser = true self.userSession = nil print("유저가 삭제 되었습니다 \(String(describing: error?.localizedDescription))") }) diff --git a/PingPong/Projects/Core/Common/Sources/ViewModel/CommonViewViewModel.swift b/PingPong/Projects/Core/Common/Sources/ViewModel/CommonViewViewModel.swift index 566be144..464bca99 100644 --- a/PingPong/Projects/Core/Common/Sources/ViewModel/CommonViewViewModel.swift +++ b/PingPong/Projects/Core/Common/Sources/ViewModel/CommonViewViewModel.swift @@ -19,14 +19,10 @@ public class CommonViewViewModel: ObservableObject { public init() { isLogin = UserDefaults.standard.bool(forKey: "isLogin") - isFirstUserPOPUP = UserDefaults.standard.bool(forKey: "isFirstUserPOPUP") + } - @AppStorage("isFirstUserPOPUP") public var isFirstUserPOPUP: Bool = false { - didSet { - self.firstUserPOPUP = isFirstUserPOPUP - } - } + @AppStorage("isFirstUserPOPUP") public var isFirstUserPOPUP: Bool = true @Published public var isLoginCheck: Bool = false { didSet { diff --git a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift index 2145c687..e70d89cc 100644 --- a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift +++ b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift @@ -47,14 +47,7 @@ public struct CoreView: View { .ignoresSafeArea(.keyboard) } .modal(with: sheetManager, viewModel: viewModel) - .onAppear { - if viewModel.isFirstUserPOPUP { - self.viewModel.isFirstUserPOPUP = true - } else { - self.viewModel.isFirstUserPOPUP = false - - } - } + .popup(isPresented: $viewModel.isFirstUserPOPUP) { CustomPOPUP( image: .empty, @@ -62,7 +55,7 @@ public struct CoreView: View { title1: "명언을 확인해보세요", subTitle: "", useGif: true, confirmAction: { isFistUserPOPUP = false - viewModel.isFirstUserPOPUP = true +// viewModel.isFirstUserPOPUP = true }) } customize: { popup in popup diff --git a/PingPong/Projects/Feature/OnBoarding/Sources/UI/View/MainView/LoginView.swift b/PingPong/Projects/Feature/OnBoarding/Sources/UI/View/MainView/LoginView.swift index f7734077..b4df57f4 100644 --- a/PingPong/Projects/Feature/OnBoarding/Sources/UI/View/MainView/LoginView.swift +++ b/PingPong/Projects/Feature/OnBoarding/Sources/UI/View/MainView/LoginView.swift @@ -81,9 +81,6 @@ public struct LoginView: View { } .onAppear{ authViewModel.getRefreshToken() - if authViewModel.isDeletAuth { - authViewModel.deleteAuth = true - } } .popup(isPresented: $authViewModel.deleteAuth) { WithDrawPOPUP( diff --git a/PingPong/Projects/Feature/OnBoarding/Sources/ViewModel/OnBoardingViewModel.swift b/PingPong/Projects/Feature/OnBoarding/Sources/ViewModel/OnBoardingViewModel.swift index add5d16c..de879e2f 100644 --- a/PingPong/Projects/Feature/OnBoarding/Sources/ViewModel/OnBoardingViewModel.swift +++ b/PingPong/Projects/Feature/OnBoarding/Sources/ViewModel/OnBoardingViewModel.swift @@ -66,7 +66,6 @@ public class OnBoardingViewModel: ObservableObject { @Published public var isSignUP: Bool = false @AppStorage("completdSignUP") public var completdSignUP: Bool = false @Published public var alreadySignUP: Bool = false - @AppStorage("isFirstUserPOPUP") public var isFirstUserPOPUP: Bool = false let unicodeArray: [Character] = CheckRegister.generateUnicodeArray() @Published var flavorArray: SearchViewButtonInfo = SearchViewButtonInfo(title: .flavor, options: [ @@ -99,7 +98,6 @@ public class OnBoardingViewModel: ObservableObject { public init() { - isFirstUserPOPUP = UserDefaults.standard.bool(forKey: "isFirstUserPOPUP") isSignUP = UserDefaults.standard.bool(forKey: "isSignUP") completdSignUP = UserDefaults.standard.bool(forKey: "completdSignUP") alreadySignUP = UserDefaults.standard.bool(forKey: "alreadySignUP") diff --git a/PingPong/Projects/Feature/Profile/Sources/UI/View/WithDraw/WithDrawView.swift b/PingPong/Projects/Feature/Profile/Sources/UI/View/WithDraw/WithDrawView.swift index f4dd65f2..0f8ab73b 100644 --- a/PingPong/Projects/Feature/Profile/Sources/UI/View/WithDraw/WithDrawView.swift +++ b/PingPong/Projects/Feature/Profile/Sources/UI/View/WithDraw/WithDrawView.swift @@ -59,7 +59,6 @@ struct WithDrawView: View { Task { await profileViewModel.withDrawPost(userID: "\(authViewModel.userid)", reason: profileViewModel.selectWithDrawReason, successCompletion: { authViewModel.deleteAuth = true - authViewModel.isDeletAuth = true viewModel.isLoginCheck = false profileViewModel.randomNickName = ""