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:
Gil Eluard
2022-04-27 13:31:14 +02:00
committed by GitHub
parent 2b5989bc9b
commit 987eb7d5c0
23 changed files with 537 additions and 60 deletions
@@ -61,6 +61,13 @@ class MatrixItemChooserService: MatrixItemChooserServiceProtocol {
var loadingText: String? {
itemsProcessor.loadingText
}
var itemCount: Int {
var itemCount = 0
for section in sections {
itemCount += section.items.count
}
return itemCount
}
// MARK: - Setup
@@ -118,6 +125,22 @@ class MatrixItemChooserService: MatrixItemChooserServiceProtocol {
}
}
}
func selectAllItems() {
var newSelection: Set<String> = Set()
for section in sections {
for item in section.items {
newSelection.insert(item.id)
}
}
self.selectedItemIds = newSelection
selectedItemIdsSubject.send(selectedItemIds)
}
func deselectAllItems() {
self.selectedItemIds = Set()
selectedItemIdsSubject.send(selectedItemIds)
}
// MARK: - Private