Skip to content
Merged
22 changes: 16 additions & 6 deletions MLS/Domain/Domain/UseCaseImpl/AuthAPI/WithdrawUseCaseImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@ public class WithdrawUseCaseImpl: WithdrawUseCase {
}

public func execute() -> Completable {
switch tokenRepository.deleteToken(type: .accessToken) {
case .success:
return authRepository.withdraw()
case .failure(let error):
return .error(error)
}
return authRepository.withdraw()
.andThen(Completable.deferred { [weak self] in
guard let self = self else { return .empty() }

let results: [Result<Void, Error>] = [
self.tokenRepository.deleteToken(type: .accessToken),
self.tokenRepository.deleteToken(type: .refreshToken),
self.tokenRepository.deleteToken(type: .fcmToken)
]

for result in results {
if case .failure(let error) = result {
return .error(error)
}
}
return .empty()
})
}
}
6 changes: 3 additions & 3 deletions MLS/MLS.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions MLS/MLS/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import MyPageFeatureInterface

import RxSwift

public final class AppCoordinator {
public final class AppCoordinator: AppCoordinatorProtocol {
// MARK: - Properties
private let window: UIWindow
public var window: UIWindow?
private let dictionaryMainViewFactory: DictionaryMainViewFactory
private let bookmarkMainFactory: BookmarkMainFactory
private let myPageMainFactory: MyPageMainFactory
Expand All @@ -22,7 +22,7 @@ public final class AppCoordinator {

// MARK: - Init
public init(
window: UIWindow,
window: UIWindow?,
dictionaryMainViewFactory: DictionaryMainViewFactory,
bookmarkMainFactory: BookmarkMainFactory,
myPageMainFactory: MyPageMainFactory,
Expand Down Expand Up @@ -64,7 +64,7 @@ public final class AppCoordinator {

// MARK: - Private Helper
private func setRoot(_ viewController: UIViewController) {
window.rootViewController = viewController
window.makeKeyAndVisible()
window?.rootViewController = viewController
window?.makeKeyAndVisible()
}
}
Loading