fix: 【应用】- 嵌入第三方的窗口,点击 X 关闭窗口后,在点击入口无法打开小窗口,只能刷新页面。

This commit is contained in:
shaohuzhang1 2024-03-06 14:25:39 +08:00
parent de920a6a44
commit 0e3f68db7f

View File

@ -68,30 +68,13 @@ function embedChatbot() {
cursor: pointer;
`
close_button.onclick = () => {
document.body.removeChild(chat_container)
chat_button.style['display']='block'
chat_container.style['display']='none'
}
chat_container.append(close_button)
document.body.append(chat_container)
let is_404=false
chat_button.onclick = ($event) => {
if( chat_container.style['display']=='block'){
chat_container.style['display']='none'
} else {
if(auth(t.token,t.protocol, t.host)){
if(is_404){
document.body.removeChild(chat_container)
document.body.append(chat_container)
is_404=false
}
chat_container.style['display']='block'
}else{
is_404=true
}
}
chat_container.style['display']=chat_container.style['display']=='block'?'none':'block'
}
sty = document.createElement('style')
sty.innerText = ` #chat_container {