fluffychat merge
This commit is contained in:
commit
cc99ca0962
2 changed files with 9 additions and 6 deletions
|
|
@ -46,7 +46,6 @@ import '../../widgets/matrix.dart';
|
|||
import 'package:fluffychat/utils/tor_stub.dart'
|
||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
||||
|
||||
|
||||
enum PopupMenuAction {
|
||||
settings,
|
||||
invite,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import 'dart:io';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:desktop_notifications/desktop_notifications.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ import 'package:fluffychat/l10n/l10n.dart';
|
|||
import 'package:fluffychat/utils/client_download_content_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/widgets/fluffy_chat_app.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
extension LocalNotificationsExtension on MatrixState {
|
||||
|
|
@ -97,9 +98,12 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
],
|
||||
);
|
||||
notification.action.then((actionStr) {
|
||||
final action = DesktopNotificationActions.values
|
||||
.singleWhere((a) => a.name == actionStr);
|
||||
switch (action) {
|
||||
var action = DesktopNotificationActions.values
|
||||
.singleWhereOrNull((a) => a.name == actionStr);
|
||||
if (action == null && actionStr == "default") {
|
||||
action = DesktopNotificationActions.openChat;
|
||||
}
|
||||
switch (action!) {
|
||||
case DesktopNotificationActions.seen:
|
||||
event.room.setReadMarker(
|
||||
event.eventId,
|
||||
|
|
@ -108,7 +112,7 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
);
|
||||
break;
|
||||
case DesktopNotificationActions.openChat:
|
||||
context.go('/rooms/${event.room.id}');
|
||||
FluffyChatApp.router.go('/rooms/${event.room.id}');
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue