chore: Better routing to space id
This commit is contained in:
parent
765bff9e32
commit
70c5f03e8d
3 changed files with 7 additions and 0 deletions
|
|
@ -114,6 +114,7 @@ abstract class AppRoutes {
|
|||
? TwoColumnLayout(
|
||||
mainView: ChatList(
|
||||
activeChat: state.pathParameters['roomid'],
|
||||
activeSpace: state.uri.queryParameters['spaceId'],
|
||||
displayNavigationRail:
|
||||
state.path?.startsWith('/rooms/settings') != true,
|
||||
),
|
||||
|
|
@ -132,6 +133,7 @@ abstract class AppRoutes {
|
|||
? const EmptyPage()
|
||||
: ChatList(
|
||||
activeChat: state.pathParameters['roomid'],
|
||||
activeSpace: state.uri.queryParameters['spaceId'],
|
||||
),
|
||||
),
|
||||
routes: [
|
||||
|
|
|
|||
|
|
@ -72,11 +72,13 @@ extension LocalizedActiveFilter on ActiveFilter {
|
|||
class ChatList extends StatefulWidget {
|
||||
static BuildContext? contextForVoip;
|
||||
final String? activeChat;
|
||||
final String? activeSpace;
|
||||
final bool displayNavigationRail;
|
||||
|
||||
const ChatList({
|
||||
super.key,
|
||||
required this.activeChat,
|
||||
this.activeSpace,
|
||||
this.displayNavigationRail = false,
|
||||
});
|
||||
|
||||
|
|
@ -400,6 +402,7 @@ class ChatListController extends State<ChatList>
|
|||
@override
|
||||
void initState() {
|
||||
_initReceiveSharingIntent();
|
||||
_activeSpaceId = widget.activeSpace;
|
||||
|
||||
scrollController.addListener(_onScroll);
|
||||
_waitForFirstSync();
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ class PublicRoomDialog extends StatelessWidget {
|
|||
if (chunk?.roomType != 'm.space' &&
|
||||
!client.getRoomById(result.result!)!.isSpace) {
|
||||
context.go('/rooms/$roomId');
|
||||
} else {
|
||||
context.go('/rooms?spaceId=$roomId');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue