From d2a461b904a9c0d44bb8cbaf39b7bb53b9680420 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sat, 25 Jan 2020 16:47:27 -0400 Subject: [PATCH] signal disconnect by nulling out outgoing feed --- services/gunDB/contact-api/actions.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 6ee5d514..f8b38adf 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -1077,24 +1077,10 @@ const disconnect = async pub => { .get(pub) .put(null) - const msgs = getUser() + await user .get(Key.OUTGOINGS) .get(outGoingID) - .get(Key.MESSAGES) - - msgs - .once() - .map() - .once((_, key) => { - msgs.get(key).put(null) - }) - - // give it a bit of time so it can delete the messages - return new Promise(res => { - setTimeout(() => { - res() - }, 500) - }) + .put(null) } module.exports = {