Merge pull request #483 from pangeachat/remove-subspace-buttons
Remove button for subspaces
This commit is contained in:
commit
8ca8864c52
3 changed files with 10 additions and 3 deletions
|
|
@ -436,7 +436,9 @@ class ChatDetailsView extends StatelessWidget {
|
|||
onTap: () =>
|
||||
context.go('/rooms/${room.id}/invite'),
|
||||
),
|
||||
if (room.showClassEditOptions && room.isSpace)
|
||||
if (room.showClassEditOptions &&
|
||||
room.isSpace &&
|
||||
!room.isSubspace)
|
||||
SpaceDetailsToggleAddStudentsTile(
|
||||
controller: controller,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
part of "pangea_room_extension.dart";
|
||||
|
||||
extension ChildrenAndParentsRoomExtension on Room {
|
||||
bool get _isSubspace => _pangeaSpaceParents.isNotEmpty;
|
||||
|
||||
//note this only will return rooms that the user has joined or been invited to
|
||||
List<Room> get _joinedChildren {
|
||||
if (!isSpace) return [];
|
||||
|
|
@ -91,7 +93,7 @@ extension ChildrenAndParentsRoomExtension on Room {
|
|||
String _nameIncludingParents(BuildContext context) {
|
||||
String nameSoFar = getLocalizedDisplayname(MatrixLocals(L10n.of(context)!));
|
||||
Room currentRoom = this;
|
||||
if (currentRoom.pangeaSpaceParents.isEmpty) {
|
||||
if (!currentRoom._isSubspace) {
|
||||
return nameSoFar;
|
||||
}
|
||||
currentRoom = currentRoom.pangeaSpaceParents.first;
|
||||
|
|
@ -100,7 +102,7 @@ extension ChildrenAndParentsRoomExtension on Room {
|
|||
nameToAdd =
|
||||
nameToAdd.length <= 10 ? nameToAdd : "${nameToAdd.substring(0, 10)}...";
|
||||
nameSoFar = '$nameToAdd > $nameSoFar';
|
||||
if (currentRoom.pangeaSpaceParents.isEmpty) {
|
||||
if (!currentRoom._isSubspace) {
|
||||
return nameSoFar;
|
||||
}
|
||||
return "... > $nameSoFar";
|
||||
|
|
|
|||
|
|
@ -122,6 +122,9 @@ extension PangeaRoom on Room {
|
|||
}) async =>
|
||||
await _pangeaSetSpaceChild(roomId, suggested: suggested);
|
||||
|
||||
/// Checks if this space has a parent space
|
||||
bool get isSubspace => _isSubspace;
|
||||
|
||||
// class_and_exchange_settings
|
||||
|
||||
DateTime? get rulesUpdatedAt => _rulesUpdatedAt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue