From ddd052b5d46de0e7068620b479d5055540451381 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 18 Nov 2020 15:05:31 -0400 Subject: [PATCH] filter out nuleld out messages --- services/gunDB/contact-api/events/index.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/services/gunDB/contact-api/events/index.js b/services/gunDB/contact-api/events/index.js index 5f7de532..f129e1e3 100644 --- a/services/gunDB/contact-api/events/index.js +++ b/services/gunDB/contact-api/events/index.js @@ -491,12 +491,15 @@ const processChats = debounce(() => { } /** @type {ChatMessage[]} */ - let msgs = Object.entries(out.messages).map(([mid, m]) => ({ - id: mid, - outgoing: true, - body: m.body, - timestamp: m.timestamp - })) + let msgs = Object.entries(out.messages) + .map(([mid, m]) => ({ + id: mid, + outgoing: true, + body: m.body, + timestamp: m.timestamp + })) + // filter out null messages + .filter(m => typeof m.body === 'string') const incoming = pubToFeed[out.with]