chore: Follow up router fixes

This commit is contained in:
krille-chan 2023-08-13 13:41:01 +02:00
commit b7dac8365a
No known key found for this signature in database
8 changed files with 54 additions and 67 deletions

View file

@ -33,10 +33,9 @@ extension LocalNotificationsExtension on MatrixState {
if (room.notificationCount == 0) return;
final event = Event.fromJson(eventUpdate.content, room);
final title =
room.getLocalizedDisplayname(MatrixLocals(L10n.of(navigatorContext)!));
final title = room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!));
final body = await event.calcLocalizedBody(
MatrixLocals(L10n.of(navigatorContext)!),
MatrixLocals(L10n.of(context)!),
withSenderNamePrefix:
!room.isDirectChat || room.lastEvent?.senderId == client.userID,
plaintextBody: true,
@ -95,11 +94,11 @@ extension LocalNotificationsExtension on MatrixState {
actions: [
NotificationAction(
DesktopNotificationActions.openChat.name,
L10n.of(navigatorContext)!.openChat,
L10n.of(context)!.openChat,
),
NotificationAction(
DesktopNotificationActions.seen.name,
L10n.of(navigatorContext)!.markAsRead,
L10n.of(context)!.markAsRead,
),
],
hints: [
@ -114,7 +113,7 @@ extension LocalNotificationsExtension on MatrixState {
room.setReadMarker(event.eventId, mRead: event.eventId);
break;
case DesktopNotificationActions.openChat:
navigatorContext.go(['', 'rooms', room.id].join('/'));
context.go(['', 'rooms', room.id].join('/'));
break;
}
});