From 5daf69788841ac40d928c67f2a1169b05681690e Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 20 Jul 2020 20:03:18 -0400 Subject: [PATCH] filter new received reqs if requestor is in disconnected state --- services/gunDB/contact-api/events/onReceivedReqs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/gunDB/contact-api/events/onReceivedReqs.js b/services/gunDB/contact-api/events/onReceivedReqs.js index 0398d688..6f7aaab7 100644 --- a/services/gunDB/contact-api/events/onReceivedReqs.js +++ b/services/gunDB/contact-api/events/onReceivedReqs.js @@ -50,6 +50,7 @@ const react = debounce(() => { for (const [id, req] of Object.entries(currAddressData)) { const inContact = Array.isArray(pubToFeed[req.from]) + const isDisconnected = pubToFeed[req.from] === 'disconnected' if (typeof pubToAvatar[req.from] === 'undefined') { // eslint-disable-next-line no-empty-function @@ -60,7 +61,7 @@ const react = debounce(() => { Streams.onDisplayName(() => {}, req.from)() } - if (!inContact) { + if (!inContact && !isDisconnected) { newReceivedReqsMap[req.from] = { id, requestorAvatar: pubToAvatar[req.from] || null,