Skip to content

Commit

Permalink
### 5.0.81 in PROD
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Jul 30, 2024
1 parent c93eadb commit a673be9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*Dario De Pascalis*
### **Copyrigth**: *Tiledesk SRL*

### 5.0.81 in PROD

### 5.0.81-rc.2
- added: blank.html page to integrate widget on webview

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@chat21/chat21-web-widget",
"author": "Tiledesk SRL",
"version": "5.0.81-rc.2",
"version": "5.0.81",
"license": "MIT",
"homepage": "https://www.tiledesk.com",
"repository": {
Expand Down
27 changes: 21 additions & 6 deletions src/assets/twp/blank.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,31 @@
window.Tiledesk('onInit', function(event_data) {
console.log("onInit Tiledesk FN", event_data);
//open widget after 3s if is closed
// setTimeout(() => {
// if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
// window.Tiledesk('open')
// }
// }, 3000);
setTimeout(() => {
if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
window.Tiledesk('open')
}
}, 3000);
});

window.Tiledesk('onAuthStateChanged', function(event_data) {
console.log("AUTHENTICATED!", event_data);
console.log("onAuthStateChanged Tiledesk FN!", event_data);
});

window.Tiledesk('onMessageCreated', function(event_data) {
// console.log("onMessageCreated!", event_data);
window.parent.postMessage(event_data.detail, '*')
// if(event_data.detail.isLogged){
// console.log("isLogged!!!!", event_data);
// window.Tiledesk('show')
// }
});

window.addEventListener('message', (event_data)=> {
if(event_data && event_data.data && event_data.data.action === 'restart'){
window.Tiledesk('startConversation', event_data.data.intentName)
}
})
</script>

<script type="application/javascript">
Expand Down

0 comments on commit a673be9

Please sign in to comment.