signal disconnect by nulling out outgoing feed

This commit is contained in:
Daniel Lugo 2020-01-25 16:47:27 -04:00
parent 1b44fe1fd0
commit d2a461b904

View file

@ -1077,24 +1077,10 @@ const disconnect = async pub => {
.get(pub) .get(pub)
.put(null) .put(null)
const msgs = getUser() await user
.get(Key.OUTGOINGS) .get(Key.OUTGOINGS)
.get(outGoingID) .get(outGoingID)
.get(Key.MESSAGES) .put(null)
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)
})
} }
module.exports = { module.exports = {