fix: Space settings routing problems

This commit is contained in:
Christian Pauly 2021-08-04 10:15:42 +02:00
parent 1d92af38cb
commit c77ea2e325
4 changed files with 20 additions and 16 deletions

View File

@ -240,9 +240,9 @@ class ChatDetailsController extends State<ChatDetails> {
if ((room.states['im.ponies.room_emotes'] ?? <String, Event>{})
.keys
.any((String s) => s.isNotEmpty)) {
VRouter.of(context).to('/rooms/${room.id}/details/multiple_emotes');
VRouter.of(context).to('multiple_emotes');
} else {
VRouter.of(context).to('/rooms/${room.id}/details/emotes');
VRouter.of(context).to('emotes');
}
}

View File

@ -316,8 +316,8 @@ class ChatDetailsView extends StatelessWidget {
foregroundColor: Colors.grey,
child: Icon(Icons.edit_attributes_outlined),
),
onTap: () => VRouter.of(context)
.to('/rooms/${room.id}/details/permissions'),
onTap: () =>
VRouter.of(context).to('permissions'),
),
Divider(thickness: 1),
ListTile(
@ -343,8 +343,8 @@ class ChatDetailsView extends StatelessWidget {
radius: Avatar.defaultSize / 2,
child: Icon(Icons.add_outlined),
),
onTap: () => VRouter.of(context)
.to('/rooms/${room.id}/invite'),
onTap: () =>
VRouter.of(context).to('invite'),
)
: Container(),
],

View File

@ -18,7 +18,9 @@ class ChatPermissionsSettingsView extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
leading: VRouter.of(context).path.startsWith('/spaces/')
? null
: IconButton(
icon: Icon(Icons.close_outlined),
onPressed: () =>
VRouter.of(context).to('/rooms/${controller.roomId}'),

View File

@ -21,7 +21,9 @@ class InvitationSelectionView extends StatelessWidget {
room.name?.isEmpty ?? false ? L10n.of(context).group : room.name;
return Scaffold(
appBar: AppBar(
leading: IconButton(
leading: VRouter.of(context).path.startsWith('/spaces/')
? null
: IconButton(
icon: Icon(Icons.close_outlined),
onPressed: () =>
VRouter.of(context).to('/rooms/${controller.roomId}'),