Introduce RiotSettings.showAllRoomsInHomeSpace and adapt changes in filter options

This commit is contained in:
ismailgulek
2021-10-19 16:36:35 +03:00
parent 8c2bb8a3da
commit f8c024672d
4 changed files with 18 additions and 4 deletions
@@ -45,7 +45,7 @@ class SpaceMenuViewModel: SpaceMenuViewModelType {
self.menuItems = spaceMenuItems
} else {
self.menuItems = [
SpaceMenuListItemViewData(action: .showAllRoomsInHomeSpace, style: .toggle, title: VectorL10n.spaceHomeShowAllRooms, icon: nil, value: MXKAppSettings.standard().showAllRoomsInHomeSpace)
SpaceMenuListItemViewData(action: .showAllRoomsInHomeSpace, style: .toggle, title: VectorL10n.spaceHomeShowAllRooms, icon: nil, value: RiotSettings.shared.showAllRoomsInHomeSpace)
]
}
}
@@ -70,8 +70,8 @@ class SpaceMenuViewModel: SpaceMenuViewModelType {
private func processAction(with action: SpaceMenuListItemAction, at indexPath: IndexPath) {
switch action {
case .showAllRoomsInHomeSpace:
MXKAppSettings.standard().showAllRoomsInHomeSpace = !MXKAppSettings.standard().showAllRoomsInHomeSpace
self.menuItems[indexPath.row].value = MXKAppSettings.standard().showAllRoomsInHomeSpace
RiotSettings.shared.showAllRoomsInHomeSpace.toggle()
self.menuItems[indexPath.row].value = RiotSettings.shared.showAllRoomsInHomeSpace
self.viewDelegate?.spaceMenuViewModel(self, didUpdateViewState: .deselect)
case .leaveSpace:
self.leaveSpace()