Session overview screen

This commit is contained in:
Aleksandrs Proskurins
2022-09-23 17:16:18 +03:00
parent db2bccc7be
commit 6fc2d397d9
18 changed files with 545 additions and 29 deletions

View File

@@ -53,7 +53,11 @@ class UserSessionsOverviewViewModel: UserSessionsOverviewViewModelType, UserSess
case .verifyCurrentSession:
self.completion?(.verifyCurrentSession)
case .viewCurrentSessionDetails:
self.completion?(.showCurrentSessionDetails)
guard let currentSessionInfo = userSessionsOverviewService.lastOverviewData.currentSessionInfo else {
assertionFailure("currentSessionInfo should be present")
return
}
self.completion?(.showCurrentSessionOverview(sessionInfo: currentSessionInfo))
case .viewAllUnverifiedSessions:
self.completion?(.showAllUnverifiedSessions)
case .viewAllInactiveSessions:
@@ -61,7 +65,11 @@ class UserSessionsOverviewViewModel: UserSessionsOverviewViewModelType, UserSess
case .viewAllOtherSessions:
self.completion?(.showAllOtherSessions)
case .tapUserSession(let sessionId):
self.completion?(.showUserSessionDetails(sessionId))
guard let sessionInfo = userSessionsOverviewService.getOtherSession(sessionId: sessionId) else {
assertionFailure("missing session info")
return
}
self.completion?(.showUserSessionOverview(sessionInfo: sessionInfo))
}
}