SP3.1: Update room settings for Spaces #5231

- Update after review
This commit is contained in:
Gil Eluard
2022-02-28 16:07:09 +01:00
parent bbff0a5c6f
commit c84285955b
52 changed files with 878 additions and 519 deletions

View File

@@ -40,10 +40,6 @@ class RoomRestrictedAccessSpaceChooserItemsProcessor: MatrixItemChooserProcessor
}
func computeSelection(withIds itemsIds: [String], completion: @escaping (Result<Void, Error>) -> Void) {
// DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
// completion(.success(()))
// }
session.matrixRestClient.setRoomJoinRule(.restricted, forRoomWithId: roomId, allowedParentIds: itemsIds) { response in
switch response {
case .failure(let error):

View File

@@ -33,18 +33,21 @@ struct RoomRestrictedAccessSpaceChooserSelector: View {
MatrixItemChooser(viewModel: viewModel, listBottomPadding: nil)
.background(theme.colors.background)
.navigationTitle(VectorL10n.roomAccessSettingsScreenNavTitle)
// .navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button(VectorL10n.cancel) {
viewModel.send(viewAction: .cancel)
}
.foregroundColor(viewModel.viewState.loading ? theme.colors.quarterlyContent : theme.colors.accent)
.opacity(viewModel.viewState.loading ? 0.7 : 1)
.disabled(viewModel.viewState.loading)
}
ToolbarItem(placement: .confirmationAction) {
Button(VectorL10n.done) {
viewModel.send(viewAction: .done)
}
.foregroundColor(viewModel.viewState.selectedItemIds.isEmpty || viewModel.viewState.loading ? theme.colors.quarterlyContent : theme.colors.accent)
.opacity(viewModel.viewState.selectedItemIds.isEmpty || viewModel.viewState.loading ? 0.7 : 1)
.disabled(viewModel.viewState.selectedItemIds.isEmpty || viewModel.viewState.loading)
}
}