Fix in-app notification "null"

This commit is contained in:
Diego Mello 2024-05-22 13:38:53 -03:00
parent ebab2cfa11
commit 628c3fc764
1 changed files with 10 additions and 8 deletions
app/lib/methods/subscriptions

View File

@ -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) {