From 73db010db4d398e69f52807fb41b3a52570f04ea Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 1 Jun 2021 12:56:43 +0200 Subject: [PATCH] fix: Make QueuedToDeviceEvent store content as String OR Map Temporary fix to stay compatible to Moor AND a key value store --- lib/src/utils/QueuedToDeviceEvent.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/utils/QueuedToDeviceEvent.dart b/lib/src/utils/QueuedToDeviceEvent.dart index b73f1c7f..6f076427 100644 --- a/lib/src/utils/QueuedToDeviceEvent.dart +++ b/lib/src/utils/QueuedToDeviceEvent.dart @@ -15,6 +15,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +import 'dart:convert'; + class QueuedToDeviceEvent { final int id; final String type; @@ -28,7 +30,10 @@ class QueuedToDeviceEvent { id: json['id'], type: json['type'], txnId: json['txn_id'], - content: json['content'], + // Temporary fix to stay compatible to Moor AND a key value store + content: json['content'] is String + ? jsonDecode(json['content']) + : json['content'], ); Map toJson() => {