fix: PushNotification fromJson - toJson fails

This commit is contained in:
Krille 2025-02-03 11:30:50 +01:00
parent 3353518cad
commit eb9bd0620f
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 5 additions and 3 deletions

View File

@ -50,9 +50,11 @@ class PushNotification {
? (json['devices'] as List)
.map((d) => PushNotificationDevice.fromJson(d))
.toList()
: (jsonDecode(json['devices'] as String) as List)
.map((d) => PushNotificationDevice.fromJson(d))
.toList(),
: json['devices'] is String
? (jsonDecode(json['devices'] as String) as List)
.map((d) => PushNotificationDevice.fromJson(d))
.toList()
: null,
eventId: json['event_id'] as String?,
prio: json['prio'] as String?,
roomAlias: json['room_alias'] as String?,