Fixes cache cleaning behavior after sdk change

This commit is contained in:
Stefan Ceriu
2023-05-12 18:24:20 +03:00
committed by Stefan Ceriu
parent 1981270840
commit a2b38f7656
3 changed files with 18 additions and 18 deletions
@@ -458,20 +458,21 @@ class AppCoordinator: AppCoordinatorProtocol {
private func clearCache() {
showLoadingIndicator()
defer {
hideLoadingIndicator()
}
navigationRootCoordinator.setRootCoordinator(SplashScreenCoordinator())
userSession.clientProxy.stopSync()
userSessionFlowCoordinator?.stop()
userSessionStore.clearCacheFor(userSession: userSession)
let userID = userSession.userID
tearDownUserSession()
stateMachine.processEvent(.startWithExistingSession)
// Allow for everything to deallocate properly
Task {
try await Task.sleep(for: .seconds(2))
userSessionStore.clearCache(for: userID)
stateMachine.processEvent(.startWithExistingSession)
hideLoadingIndicator()
}
}
}