chore: do as suggestion
This commit is contained in:
parent
cbb2810b37
commit
ccb2a23075
3 changed files with 3 additions and 10 deletions
|
|
@ -346,7 +346,6 @@ abstract class AppRoutes {
|
|||
shareItems ??= [];
|
||||
shareItems.add(TextShareItem(body));
|
||||
}
|
||||
final userId = state.uri.queryParameters['userId'];
|
||||
return defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
|
|
@ -354,7 +353,6 @@ abstract class AppRoutes {
|
|||
roomId: state.pathParameters['roomid']!,
|
||||
shareItems: shareItems,
|
||||
eventId: state.uri.queryParameters['event'],
|
||||
userId: userId,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,21 +46,16 @@ class ChatPage extends StatelessWidget {
|
|||
final String roomId;
|
||||
final List<ShareItem>? shareItems;
|
||||
final String? eventId;
|
||||
final String? userId;
|
||||
|
||||
const ChatPage({
|
||||
super.key,
|
||||
required this.roomId,
|
||||
this.eventId,
|
||||
this.shareItems,
|
||||
this.userId,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (userId != null) {
|
||||
Matrix.of(context).setActiveClientWithUserId(userId!);
|
||||
}
|
||||
final room = Matrix.of(context).client.getRoomById(roomId);
|
||||
if (room == null) {
|
||||
return Scaffold(
|
||||
|
|
|
|||
|
|
@ -148,10 +148,10 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
break;
|
||||
case DesktopNotificationActions.openChat:
|
||||
if (userId != null) {
|
||||
FluffyChatApp.router.go('/rooms/${event.room.id}?userId=$userId');
|
||||
} else {
|
||||
FluffyChatApp.router.go('/rooms/${event.room.id}');
|
||||
Matrix.of(context).setActiveClientWithUserId(userId);
|
||||
}
|
||||
|
||||
FluffyChatApp.router.go('/rooms/${event.room.id}');
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue