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