Cannot Switch Chat Box in one page without refreshing #9714
Unanswered
heatonmar
asked this question in
Chatwoot APIs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My website shows namecards of agents, with "Start Chat" button under each agent's namecard. The button was binded by the website token (Each Agent has his own inbox with single inbox_id) of each agent's widget. So when I tried to talk with Agent A, it worked. But when I tried to talk with Agent B, I clicked on start chat button under Agent B's name card. Instead of switching channel, the popout widget still remained on Agent A's window so I found it hard to talk with Agent B (Honestly what I could do was just to refresh the page and start the chat again, which would work but inconvenient to users ).
Here's my widget js code:
function initializeChatwoot(contactId, email, websiteToken) {
alert('Chat Started');
window.chatwootSettings = {"position":"right","type":"standard","launcherTitle":"Contact Me"};
(function(d,t) {
var BASE_URL="http://myserverip:3000/";
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=BASE_URL+"/packs/js/sdk.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g,s);
g.onload=function(){
window.chatwootSDK.run({
websiteToken: websiteToken,
baseUrl: BASE_URL
});
window.addEventListener("chatwoot:ready", function () {
}
Beta Was this translation helpful? Give feedback.
All reactions