Remove unnecessary gun subs (let front handle)

This commit is contained in:
Daniel Lugo 2021-04-29 15:59:26 -04:00
parent 0ffbb6bbd6
commit 2be84451d1

View file

@ -44,22 +44,11 @@ const react = debounce(() => {
const newReceivedReqsMap = {}
const pubToFeed = Streams.getPubToFeed()
const pubToAvatar = Streams.getPubToAvatar()
const pubToDn = Streams.getPubToDn()
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
Streams.onAvatar(() => {}, req.from)()
}
if (typeof pubToDn[req.from] === 'undefined') {
// eslint-disable-next-line no-empty-function
Streams.onDisplayName(() => {}, req.from)()
}
if (!inContact && !isDisconnected) {
newReceivedReqsMap[req.from] = {
id,
@ -133,8 +122,6 @@ const onReceivedReqs = cb => {
}
}, user)
Streams.onAvatar(react)
Streams.onDisplayName(react)
Streams.onPubToFeed(react)
subbed = true