Skip to content

Commit

Permalink
Merge pull request #88 from SAPConversationalAI/mergeToOpenSource
Browse files Browse the repository at this point in the history
Merge to open source
  • Loading branch information
JWandrocke authored May 3, 2022
2 parents b00755d + bd51bbb commit 0638f93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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,6 +1,6 @@
{
"name": "webchat",
"version": "1.4.45",
"version": "1.4.46",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Message/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Message extends Component {
}
return false
}
render () {
render () { // NOSONAR
const {
message,
isLastMessage,
Expand All @@ -79,8 +79,12 @@ class Message extends Component {
botMessageBackgroundColor,
} = preferences
const { displayIcon, attachment, participant } = message
const { type, content, error, title, markdown } = attachment
const { type, content, error, title, markdown, welcomeMessage } = attachment
const { exceptionThrownOccurred } = this.state
if (welcomeMessage) {
// Ignore unsupported WebClient feature
return null
}
if (exceptionThrownOccurred) {
const style = {
color: '#fff',
Expand Down
4 changes: 4 additions & 0 deletions src/middlewares/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const delayBetweenMessages = async (messages, dispatch) => {
dispatch({ type: 'SET_CREDENTIALS', payload: { lastMessageId } })
}
for (const msg of messages) {
if (pathOr(false, ['attachment', 'welcomeMessage'], msg)) {
// Skip new WebClient welcome messages Feature
continue
}
dispatch({ type: 'ADD_MESSAGES', payload: { messages: [msg] } })
if (lastMessageId !== msg.id) {
// If there is a delay in this message wait before showing the next message.
Expand Down

0 comments on commit 0638f93

Please sign in to comment.