Skip to content

Is this demo working ?!? #1

@guizmoau

Description

@guizmoau

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions