signal disconnect by nulling out outgoing feed
This commit is contained in:
parent
1b44fe1fd0
commit
d2a461b904
1 changed files with 2 additions and 16 deletions
|
|
@ -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 = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue