From fa8c184b6bd9f3f52c4cfdcf6ec3ada4df895671 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sat, 15 Feb 2020 15:39:19 -0400 Subject: [PATCH] correct chats --- services/gunDB/contact-api/events/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/gunDB/contact-api/events/index.js b/services/gunDB/contact-api/events/index.js index 6036a8d2..6421d2ec 100644 --- a/services/gunDB/contact-api/events/index.js +++ b/services/gunDB/contact-api/events/index.js @@ -424,11 +424,11 @@ const processChats = debounce(() => { newChats.push(chat) } - currentChats = newChats - // initial state, means non connected - .filter(c => typeof pubToFeed[c.recipientPublicKey] !== 'undefined') - // disconnected from this side - .filter(c => pubToFeed[c.recipientPublicKey] !== null) + currentChats = newChats.filter( + c => + Array.isArray(pubToFeed[c.recipientPublicKey]) || + pubToFeed[c.recipientPublicKey] === 'disconnected' + ) notifyChatsListeners() }, 750)