From 628c3fc7645fca7b4d94fe69cc1dec2b893cfc2d Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 22 May 2024 13:38:53 -0300 Subject: [PATCH] Fix in-app notification "null" --- app/lib/methods/subscriptions/rooms.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/lib/methods/subscriptions/rooms.ts b/app/lib/methods/subscriptions/rooms.ts index efa8df02c..25220cf85 100644 --- a/app/lib/methods/subscriptions/rooms.ts +++ b/app/lib/methods/subscriptions/rooms.ts @@ -399,14 +399,16 @@ export default function subscribeRooms() { // If it's from a encrypted room if (message?.t === E2E_MESSAGE_TYPE) { - // Decrypt this message content - const { msg } = await Encryption.decryptMessage({ ...message, rid }); - // If it's a direct the content is the message decrypted - if (room.t === 'd') { - notification.text = msg; - // If it's a private group we should add the sender name - } else { - notification.text = `${getSenderName(sender)}: ${msg}`; + if (message.msg) { + // Decrypt this message content + const { msg } = await Encryption.decryptMessage({ ...message, rid }); + // If it's a direct the content is the message decrypted + if (room.t === 'd') { + notification.text = msg; + // If it's a private group we should add the sender name + } else { + notification.text = `${getSenderName(sender)}: ${msg}`; + } } } } catch (e) {