fix(core): support caching peers from array results
This commit is contained in:
parent
4b22ee5b25
commit
64aae43572
1 changed files with 6 additions and 0 deletions
|
@ -109,6 +109,12 @@ export function* getAllPeersFrom(
|
||||||
obj: any
|
obj: any
|
||||||
): Iterable<tl.TypeUser | tl.TypeChat> {
|
): Iterable<tl.TypeUser | tl.TypeChat> {
|
||||||
if (typeof obj !== 'object') return
|
if (typeof obj !== 'object') return
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
for (const it of obj) {
|
||||||
|
yield* getAllPeersFrom(it)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch (obj._) {
|
switch (obj._) {
|
||||||
case 'user':
|
case 'user':
|
||||||
|
|
Loading…
Reference in a new issue