fix: open chat from notification
default should not be ignored
This commit is contained in:
parent
95172aed8f
commit
e41537271f
1 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue