mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
4850 bring leaving space experience in line with web (#6062)
* Bring leaving space experience in line with Web #4850 - Done
This commit is contained in:
+23
@@ -39,6 +39,13 @@ class MockMatrixItemChooserService: MatrixItemChooserServiceProtocol {
|
||||
var loadingText: String? {
|
||||
nil
|
||||
}
|
||||
var itemCount: Int {
|
||||
var itemCount = 0
|
||||
for section in sectionsSubject.value {
|
||||
itemCount += section.items.count
|
||||
}
|
||||
return itemCount
|
||||
}
|
||||
|
||||
init(type: MatrixItemChooserType = .room, sections: [MatrixListItemSectionData] = mockSections, selectedItemIndexPaths: [IndexPath] = []) {
|
||||
sectionsSubject = CurrentValueSubject(sections)
|
||||
@@ -79,4 +86,20 @@ class MockMatrixItemChooserService: MatrixItemChooserServiceProtocol {
|
||||
func refresh() {
|
||||
|
||||
}
|
||||
|
||||
func selectAllItems() {
|
||||
var newSelection: Set<String> = Set()
|
||||
for section in sectionsSubject.value {
|
||||
for item in section.items {
|
||||
newSelection.insert(item.id)
|
||||
}
|
||||
}
|
||||
self.selectedItemIds = newSelection
|
||||
selectedItemIdsSubject.send(selectedItemIds)
|
||||
}
|
||||
|
||||
func deselectAllItems() {
|
||||
self.selectedItemIds = Set()
|
||||
selectedItemIdsSubject.send(selectedItemIds)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user