Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 0638f93

Browse files
authored
Merge pull request #88 from SAPConversationalAI/mergeToOpenSource
Merge to open source
2 parents b00755d + bd51bbb commit 0638f93

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webchat",
3-
"version": "1.4.45",
3+
"version": "1.4.46",
44
"description": "",
55
"main": "lib/index.js",
66
"scripts": {

src/components/Message/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Message extends Component {
5555
}
5656
return false
5757
}
58-
render () {
58+
render () { // NOSONAR
5959
const {
6060
message,
6161
isLastMessage,
@@ -79,8 +79,12 @@ class Message extends Component {
7979
botMessageBackgroundColor,
8080
} = preferences
8181
const { displayIcon, attachment, participant } = message
82-
const { type, content, error, title, markdown } = attachment
82+
const { type, content, error, title, markdown, welcomeMessage } = attachment
8383
const { exceptionThrownOccurred } = this.state
84+
if (welcomeMessage) {
85+
// Ignore unsupported WebClient feature
86+
return null
87+
}
8488
if (exceptionThrownOccurred) {
8589
const style = {
8690
color: '#fff',

src/middlewares/api.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const delayBetweenMessages = async (messages, dispatch) => {
2323
dispatch({ type: 'SET_CREDENTIALS', payload: { lastMessageId } })
2424
}
2525
for (const msg of messages) {
26+
if (pathOr(false, ['attachment', 'welcomeMessage'], msg)) {
27+
// Skip new WebClient welcome messages Feature
28+
continue
29+
}
2630
dispatch({ type: 'ADD_MESSAGES', payload: { messages: [msg] } })
2731
if (lastMessageId !== msg.id) {
2832
// If there is a delay in this message wait before showing the next message.

0 commit comments

Comments
 (0)