use getters
This commit is contained in:
parent
eea9b0dac8
commit
89e07ac19f
1 changed files with 5 additions and 18 deletions
|
|
@ -23,12 +23,6 @@ const Streams = require('../streams')
|
||||||
|
|
||||||
const listeners = new Set()
|
const listeners = new Set()
|
||||||
|
|
||||||
/** @type {Streams.Avatars} */
|
|
||||||
let pubToAvatar = {}
|
|
||||||
|
|
||||||
/** @type {Streams.DisplayNames} */
|
|
||||||
let pubToDn = {}
|
|
||||||
|
|
||||||
/** @type {SimpleReceivedRequest[]} */
|
/** @type {SimpleReceivedRequest[]} */
|
||||||
let currentReqs = []
|
let currentReqs = []
|
||||||
|
|
||||||
|
|
@ -42,6 +36,8 @@ const react = () => {
|
||||||
/** @type {SimpleReceivedRequest[]} */
|
/** @type {SimpleReceivedRequest[]} */
|
||||||
const finalReqs = []
|
const finalReqs = []
|
||||||
const pubToIncoming = Streams.getPubToIncoming()
|
const pubToIncoming = Streams.getPubToIncoming()
|
||||||
|
const pubToAvatar = Streams.getPubToAvatar()
|
||||||
|
const pubToDn = Streams.getPubToDn()
|
||||||
|
|
||||||
for (const [id, req] of Object.entries(currentNode)) {
|
for (const [id, req] of Object.entries(currentNode)) {
|
||||||
const notAccepted = typeof pubToIncoming[req.from] === 'undefined'
|
const notAccepted = typeof pubToIncoming[req.from] === 'undefined'
|
||||||
|
|
@ -115,18 +111,9 @@ const onReceivedReqs = cb => {
|
||||||
}
|
}
|
||||||
}, require('../../Mediator').getUser())
|
}, require('../../Mediator').getUser())
|
||||||
|
|
||||||
Streams.onAvatar(pta => {
|
Streams.onAvatar(react)
|
||||||
pubToAvatar = pta
|
Streams.onDisplayName(react)
|
||||||
react()
|
Streams.onIncoming(react)
|
||||||
})
|
|
||||||
Streams.onDisplayName(ptd => {
|
|
||||||
pubToDn = ptd
|
|
||||||
react()
|
|
||||||
})
|
|
||||||
Streams.onIncoming(pti => {
|
|
||||||
pubToIncoming = pti
|
|
||||||
react()
|
|
||||||
})
|
|
||||||
|
|
||||||
subbed = true
|
subbed = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue