You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
problem?
When we start the client, in the first time I'd like to fetch all chats and messages, so when I call the client.getAllChats() it was returning 0 chats: [], after playing a little bit and adding a TimeOut it worked:
One idea of solution
In the same way there are some events in the ListenerLayer such as onMessage and other, perhaps
it could be added something like onReady which coulbe be sent when the chat that is ready to be be called.
In this way, I could call the client.getAllChats() inside this event instead of the timeout of 6 seconds in the initialize step.
Alternatives
Well, if I am doing something wrong to get the chats when I start the app (after I the phone connected using the qr code), please let me know, or if is there any documentation or any advanced examples I will appreciate...
Context
I can receive new messages and updates, however, I'd like to map all existing chats and messages when the application runs for the first time, after that, I won't need to call the allChats function any more.
Thanks and I will appreciate any other idea or further documentation and or examples as other way to avoid that 6 seconds.
p.s.
I was digging the documentation and the existing listeners (ListenerLayer from the listener.layer.d.ts file) before creating this Issue.
The text was updated successfully, but these errors were encountered:
huogerac
changed the title
How about creating a onReady event get better how we fetch messages?
How about creating an onReady event get better how we fetch messages?
Dec 12, 2024
huogerac
changed the title
How about creating an onReady event get better how we fetch messages?
How about creating an onReady event to get better how we fetch messages?
Dec 12, 2024
problem?
When we start the client, in the first time I'd like to fetch all chats and messages, so when I call the
client.getAllChats()
it was returning 0 chats: [], after playing a little bit and adding a TimeOut it worked:One idea of solution
In the same way there are some events in the
ListenerLayer
such asonMessage
and other, perhapsit could be added something like
onReady
which coulbe be sent when the chat that is ready to be be called.In this way, I could call the client.getAllChats() inside this event instead of the timeout of 6 seconds in the initialize step.
Alternatives
Well, if I am doing something wrong to get the chats when I start the app (after I the phone connected using the qr code), please let me know, or if is there any documentation or any advanced examples I will appreciate...
Context
I can receive new messages and updates, however, I'd like to map all existing chats and messages when the application runs for the first time, after that, I won't need to call the allChats function any more.
Thanks and I will appreciate any other idea or further documentation and or examples as other way to avoid that 6 seconds.
p.s.
I was digging the documentation and the existing listeners (ListenerLayer from the listener.layer.d.ts file) before creating this Issue.
The text was updated successfully, but these errors were encountered: