Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ Destroys the widget that was added to your page.
blipClient.destroy();
```

## Toogle chat widget
## Toggle chat widget

Toggles the chat widget window.

```javascript
blipClient.toogleChat();
blipClient.toggleChat();
```

## Send message
Expand Down
2 changes: 1 addition & 1 deletion src/BlipChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class BlipChat {
)
}

toogleChat() {
toggleChat() {
this.widget._openChat()
}

Expand Down
21 changes: 9 additions & 12 deletions src/BlipChatWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ export class BlipChatWidget {
) {
self = this
self.appKey = appKey
self.buttonColor =
buttonConfig && buttonConfig.color ? buttonConfig.color : '#2CC3D5'
self.buttonIcon =
buttonConfig && buttonConfig.icon ? buttonConfig.icon : blipIcon
self.buttonColor = buttonConfig?.color || '#2CC3D5'
self.buttonIcon = buttonConfig?.icon || blipIcon
self.authConfig = self._parseAuthConfig(authConfig)
self.account = self._addAuthTypeToExtras(account, authConfig)
self.target = target
Expand Down Expand Up @@ -86,7 +84,8 @@ export class BlipChatWidget {
document
.getElementById('blip-chat-open-iframe')
.addEventListener('click', self._openChat)
} else {
}
if (self.target) {
self._createIframe()
}
self._resizeElements()
Expand Down Expand Up @@ -138,16 +137,14 @@ export class BlipChatWidget {
}

_addAuthTypeToExtras(account, authConfig) {
let authType = authConfig
? authConfig.authType || BlipChat.GUEST_AUTH
: BlipChat.GUEST_AUTH
let authType = authConfig?.authType || BlipChat.GUEST_AUTH
if (account) {
account.extras = account.extras || {}
account.extras.authType = authType
} else {
account = {
extras: { authType }
}
return account
}
account = {
extras: { authType }
}

return account
Expand Down