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 ??= [];
|
||||||
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,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue