Wait indicator while calling external api

Hi,

I am trying to add loader/typing indicator while calling external api,
I have tried adding loader gif but unable to remove it once data got loaded.
I have tried few other delay tricks but it is not working well as time taking for api response is varying.

Can someone help me here?

Regards,
Jeevan

Hi @Jeevan454,

You might want to look into @loopmode’s post about deleting messages, that might be the solution you are looking for : Delete or hide messages

Hopefully this will help.

Happy building :robot:

Hi @Maxime_Joannette,

Thank you for response.
I would like to add a kind of typing indicator as loader until i receive api response.
I tried deleting particular message from database manually, but it is not getting removed from chat screen until i refresh the screen

Regards,
Jeevan

@Jeevan454 the store in the Frontend has a reloadConversation method. If you have some code injected in the frontend that can listen to an event, you can do that - send an event from botpress with e.g. type:“reloadConversation”, listen for that in the frontend and then call props.store.reloadConversation() there