Closed mliao95 closed 11 months ago
LGTM, would this needed to be added to CHANGELOG for npm? Or we just copy/paste commit when publishing whenever the next publish happens
This change should ideally not impact the usage or functionality of chatjs, so copying and pasting the commit on next publish should be fine.
Issue #, if available:
Closes #129, #126
Description of changes:
This change adds safeguards to multiple ChatController methods to avoid unnecessary API calls.
sendMessage
, the code will make an API call and get an error status._participantDisconnected
istrue
to avoid hitting the API callgetConnectionToken is not a function
error logconnectionHelper
is initialized before calling any methods that usegetConnectionToken
, and if it is not initialized, we log thatconnect()
needs to be called before these APIs can workBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.