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:
parent
5262395340
commit
cbb2810b37
4 changed files with 34 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue