-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
There is this part of code
function setUpContact() {
if(getCookie('contactIdentifier')){
chatwoot.contactIdentifier = getCookie('contactIdentifier');
chatwoot.contactPubsubToken = getCookie('contactPubsubToken')
}else{
xhttp.open("POST", chatwoot.chatwootAPIUrl + "inboxes/"+chatwoot.inboxIdentifier+"/contacts");
xhttp.send();
var contactPubsubToken = JSON.parse(xhttp.responseText).pubsub_token;
var contactIdentifier = JSON.parse(xhttp.responseText).source_id;
setCookie('contactIdentifier',contactIdentifier,30);
setCookie('contactPubsubToken',contactPubsubToken,30);
}
}
This xhttp request is asynch but doesnt wait for the answer....how would this will work ?
luizcarvalho
Metadata
Metadata
Assignees
Labels
No labels