Chat window re-opens on new pageload with agent initiated chats

Chat window re-opens on new pageload with agent initiated chats

When an agent initiates a chat with a web visitor and the visitor closes the chat window, I'd expect the window to stay closed and respect the visitor's preference not to chat.

However, on each subsequent page load the chat window re-opens for the web visitor.

Is this the expected behavior?

I am using the float not the embed chat. Here is the code we implemented on our website.:

var $zoho= $zoho || {livedesk:{values:{},ready:function(){}}};var d=document;s=d.createElement("script");s.type="text/javascript";s.defer=true;s.src=" https://livedesk.zoho.com/apliiq/float.ls?embedname=apliiq";t=d.getElementsByTagName("script")[0];t.parentNode.insertBefore(s,t);

$zoho.livedesk.ready=function(){
$zoho.livedesk.floatbutton.visible("hide");
function checkWidth2() {
var winSize = $(window).width();
if (winSize <= 1024) {
$zoho.livedesk.floatbutton.visible("hide");
$zoho.livedesk.floatwindow.visible("hide");
$('.chatWrap').hide();
}
else if (winSize > 1024){
$('.chatWrap').show();
$zoho.livedesk.floatwindow.visible("hide");
$zoho.livedesk.floatbutton.visible("hide");
$zoho.livedesk.floatwindow.close(function(){
$zoho.livedesk.floatbutton.visible("hide");
});
$zoho.livedesk.floatwindow.minimize(function(){
$zoho.livedesk.floatbutton.visible("hide");
});
function toggleZoho() {
if ($zoho.livedesk.floatwindow.visible("hide")) {
$zoho.livedesk.floatwindow.visible("show");
}
else {
$zoho.livedesk.floatwindow.visible("hide");
}
}
$('.chatWrap').click(function () {
toggleZoho();
});

$('.modalpopup').on('click', '.chatWrap', function () {
    toggleZoho();
});
}
}
checkWidth2();
$(window).resize(checkWidth2);

}



Thanks in advance for any help.