Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
Check that the chat container exists
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaDelBuono committed Aug 15, 2019
1 parent 982f5d0 commit b6bda57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/javascript/hmcts-webchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function parseText(text) {
}

function webchat_init(customParams) {
const version = '0.3.8';
const version = '0.3.9';
const requiredParams = [
'uuid',
'tenant',
Expand Down Expand Up @@ -197,7 +197,7 @@ function webchat_init(customParams) {
setTimeout(function() {
const chatContainer = document.querySelector('#' + window.__8x8Chat.buttonContainerId);

if (chatContainer.innerHTML === '') {
if (chatContainer && chatContainer.innerHTML === '') {
switch (window.__8x8Chat.chatDownAction) {
case 'showMessage':
chatContainer.innerHTML = params.textChatDown;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ctsc-web-chat",
"version": "0.3.8",
"version": "0.3.9",
"description": "HMCTS CTSC Web Chat",
"repository": {
"type": "git",
Expand Down

0 comments on commit b6bda57

Please sign in to comment.