1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 09:58:59 +01:00

Wait for initialization

This commit is contained in:
Daniil Gentili 2023-08-15 21:44:43 +02:00
parent 52051a5473
commit 750f72c953
2 changed files with 7 additions and 4 deletions

@ -1 +1 @@
Subproject commit fd1839fb9d22886b2775af8d049a0bc989885671
Subproject commit 406249e2a31dbe1f04686a29da1167b61d720fe3

View File

@ -139,9 +139,12 @@ final class PeerDatabase implements TLCallback
$this->usernames->clear();
}
foreach ($this->pendingDb as $key => $_) {
EventLoop::queue($key < 0 ? $this->processChat(...) : $this->processUser(...), $key);
}
EventLoop::queue(function () {
$this->API->waitForInit();
foreach ($this->pendingDb as $key => $_) {
EventLoop::queue($key < 0 ? $this->processChat(...) : $this->processUser(...), $key);
}
});
}
public function importLegacy(MemoryArray $chats, MemoryArray $fullChats): void
{