chore: do as suggestion

This commit is contained in:
ShootingStarDragons 2025-11-17 18:14:47 +09:00
commit ccb2a23075
3 changed files with 3 additions and 10 deletions

View file

@ -346,7 +346,6 @@ abstract class AppRoutes {
shareItems ??= []; shareItems ??= [];
shareItems.add(TextShareItem(body)); shareItems.add(TextShareItem(body));
} }
final userId = state.uri.queryParameters['userId'];
return defaultPageBuilder( return defaultPageBuilder(
context, context,
state, state,
@ -354,7 +353,6 @@ abstract class AppRoutes {
roomId: state.pathParameters['roomid']!, roomId: state.pathParameters['roomid']!,
shareItems: shareItems, shareItems: shareItems,
eventId: state.uri.queryParameters['event'], eventId: state.uri.queryParameters['event'],
userId: userId,
), ),
); );
}, },

View file

@ -46,21 +46,16 @@ class ChatPage extends StatelessWidget {
final String roomId; final String roomId;
final List<ShareItem>? shareItems; final List<ShareItem>? shareItems;
final String? eventId; final String? eventId;
final String? userId;
const ChatPage({ const ChatPage({
super.key, super.key,
required this.roomId, required this.roomId,
this.eventId, this.eventId,
this.shareItems, this.shareItems,
this.userId,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (userId != null) {
Matrix.of(context).setActiveClientWithUserId(userId!);
}
final room = Matrix.of(context).client.getRoomById(roomId); final room = Matrix.of(context).client.getRoomById(roomId);
if (room == null) { if (room == null) {
return Scaffold( return Scaffold(

View file

@ -148,10 +148,10 @@ extension LocalNotificationsExtension on MatrixState {
break; break;
case DesktopNotificationActions.openChat: case DesktopNotificationActions.openChat:
if (userId != null) { if (userId != null) {
FluffyChatApp.router.go('/rooms/${event.room.id}?userId=$userId'); Matrix.of(context).setActiveClientWithUserId(userId);
} else {
FluffyChatApp.router.go('/rooms/${event.room.id}');
} }
FluffyChatApp.router.go('/rooms/${event.room.id}');
break; break;
} }
}); });