fix: when user has multi counts,notification not works well

add a queryParameters, to support switch the current active user
This commit is contained in:
ShootingStarDragons 2025-08-19 22:43:41 +09:00
commit cbb2810b37
4 changed files with 34 additions and 7 deletions

View file

@ -23,7 +23,7 @@ extension LocalNotificationsExtension on MatrixState {
..src = 'assets/assets/sounds/notification.ogg'
..load();
void showLocalNotification(Event event) async {
void showLocalNotification(Event event, String? userId) async {
final roomId = event.room.id;
if (activeRoomId == roomId) {
if (kIsWeb && webHasFocus) return;
@ -147,7 +147,11 @@ extension LocalNotificationsExtension on MatrixState {
);
break;
case DesktopNotificationActions.openChat:
FluffyChatApp.router.go('/rooms/${event.room.id}');
if (userId != null) {
FluffyChatApp.router.go('/rooms/${event.room.id}?userId=$userId');
} else {
FluffyChatApp.router.go('/rooms/${event.room.id}');
}
break;
}
});