avoid possible circular dependency bug
This commit is contained in:
parent
1bb96c395a
commit
ff1589e644
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,6 @@ const logger = require('winston')
|
||||||
const ErrorCode = require('../errorCode')
|
const ErrorCode = require('../errorCode')
|
||||||
const Key = require('../key')
|
const Key = require('../key')
|
||||||
const Schema = require('../schema')
|
const Schema = require('../schema')
|
||||||
const Streams = require('../streams')
|
|
||||||
const Utils = require('../utils')
|
const Utils = require('../utils')
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode
|
* @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode
|
||||||
|
|
@ -455,6 +454,7 @@ const notifyChatsListeners = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const processChats = debounce(() => {
|
const processChats = debounce(() => {
|
||||||
|
const Streams = require('../streams')
|
||||||
const pubToAvatar = Streams.getPubToAvatar()
|
const pubToAvatar = Streams.getPubToAvatar()
|
||||||
const pubToDn = Streams.getPubToDn()
|
const pubToDn = Streams.getPubToDn()
|
||||||
const existingOutgoings = /** @type {[string, Outgoing][]} */ (Object.entries(
|
const existingOutgoings = /** @type {[string, Outgoing][]} */ (Object.entries(
|
||||||
|
|
@ -526,12 +526,12 @@ const onChats = cb => {
|
||||||
cb(currentChats)
|
cb(currentChats)
|
||||||
|
|
||||||
if (!onChatsSubbed) {
|
if (!onChatsSubbed) {
|
||||||
|
const Streams = require('../streams')
|
||||||
|
onChatsSubbed = true
|
||||||
onOutgoing(processChats)
|
onOutgoing(processChats)
|
||||||
Streams.onAvatar(processChats)
|
Streams.onAvatar(processChats)
|
||||||
Streams.onDisplayName(processChats)
|
Streams.onDisplayName(processChats)
|
||||||
Streams.onPubToFeed(processChats)
|
Streams.onPubToFeed(processChats)
|
||||||
|
|
||||||
onChatsSubbed = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue