mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 12:25:11 +00:00
chore: Follow up add chat subspace button
This commit is contained in:
parent
fd513a355f
commit
4b69b8e5e9
1 changed files with 19 additions and 9 deletions
|
@ -264,6 +264,11 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
Widget build(BuildContext context) {
|
||||
final client = Matrix.of(context).client;
|
||||
final activeSpaceId = widget.controller.activeSpaceId;
|
||||
final activeSpace = activeSpaceId == null
|
||||
? null
|
||||
: client.getRoomById(
|
||||
activeSpaceId,
|
||||
);
|
||||
final allSpaces = client.rooms.where((room) => room.isSpace);
|
||||
if (activeSpaceId == null) {
|
||||
final rootSpaces = allSpaces
|
||||
|
@ -446,12 +451,17 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
),
|
||||
onTap: () => _onJoinSpaceChild(spaceChild),
|
||||
),
|
||||
if (activeSpace?.canChangeStateEvent(
|
||||
EventTypes.spaceChild,
|
||||
) ==
|
||||
true)
|
||||
Material(
|
||||
child: ListTile(
|
||||
leading: const CircleAvatar(
|
||||
child: Icon(Icons.group_add_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context)!.addChatOrSubSpace),
|
||||
title:
|
||||
Text(L10n.of(context)!.addChatOrSubSpace),
|
||||
trailing:
|
||||
const Icon(Icons.chevron_right_outlined),
|
||||
onTap: _addChatOrSubSpace,
|
||||
|
|
Loading…
Reference in a new issue