mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Merge branch 'develop' into alfogrillo/learn_more_sheet
# Conflicts: # RiotSwiftUI/Modules/UserSessions/Coordinator/UserSessionsFlowCoordinator.swift # RiotSwiftUI/Modules/UserSessions/UserOtherSessions/Coordinator/UserOtherSessionsCoordinator.swift # RiotSwiftUI/Modules/UserSessions/UserOtherSessions/Test/UI/UserOtherSessionsUITests.swift # RiotSwiftUI/Modules/UserSessions/UserOtherSessions/UserOtherSessionsModels.swift # RiotSwiftUI/Modules/UserSessions/UserOtherSessions/UserOtherSessionsViewModel.swift # RiotSwiftUI/Modules/UserSessions/UserOtherSessions/View/UserOtherSessions.swift # RiotSwiftUI/Modules/UserSessions/UserSessionOverview/Test/UI/UserSessionOverviewUITests.swift
This commit is contained in:
+12
-2
@@ -36,7 +36,8 @@ class UserOtherSessionsViewModel: UserOtherSessionsViewModelType, UserOtherSessi
|
||||
sessionItems: sessionItems,
|
||||
header: filter.userOtherSessionsViewHeader,
|
||||
emptyItemsTitle: filter.userOtherSessionsViewEmptyResultsTitle,
|
||||
allItemsSelected: false))
|
||||
allItemsSelected: false,
|
||||
enableSignOutButton: false))
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
@@ -61,6 +62,14 @@ class UserOtherSessionsViewModel: UserOtherSessionsViewModelType, UserOtherSessi
|
||||
case .toggleAllSelection:
|
||||
toggleAllSelection()
|
||||
updateViewState()
|
||||
case .logoutAllUserSessions:
|
||||
let filteredSessions = state.bindings.filter.filterSessionsInfos(sessionInfos)
|
||||
completion?(.logoutFromUserSessions(sessionInfos: filteredSessions))
|
||||
case .logoutSelectedUserSessions:
|
||||
let selectedSessionInfos = sessionInfos.filter { sessionInfo in
|
||||
selectedSessions.contains(sessionInfo.id)
|
||||
}
|
||||
completion?(.logoutFromUserSessions(sessionInfos: selectedSessionInfos))
|
||||
case .viewSessionInfo:
|
||||
completion?(.showSessionStateInfo(filter: state.bindings.filter))
|
||||
}
|
||||
@@ -99,6 +108,8 @@ class UserOtherSessionsViewModel: UserOtherSessionsViewModelType, UserOtherSessi
|
||||
state.emptyItemsTitle = currentFilter.userOtherSessionsViewEmptyResultsTitle
|
||||
|
||||
state.allItemsSelected = sessionInfos.count == selectedSessions.count
|
||||
|
||||
state.enableSignOutButton = selectedSessions.count > 0
|
||||
}
|
||||
|
||||
private func toggleAllSelection() {
|
||||
@@ -164,7 +175,6 @@ private extension UserOtherSessionsFilter {
|
||||
filterSessionsInfos(sessionInfos)
|
||||
.map {
|
||||
UserSessionListItemViewDataFactory().create(from: $0,
|
||||
highlightSessionDetails: self == .unverified && $0.isCurrent,
|
||||
isSelected: selectedSessions.contains($0.id))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user