Skip to content

Commit

Permalink
fix(hitl): display messages of type quick_reply in hitl module
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierbriole committed Jul 1, 2019
1 parent 81bdf28 commit b38d426
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/hitl/src/backend/db.ts
Expand Up @@ -140,10 +140,12 @@ export default class HitlDb {
}

appendMessageToSession(event, sessionId, direction) {
const text = event.type === 'custom' ? event.payload.wrapped.text : event.payload.text

const message = {
session_id: sessionId,
type: event.type,
text: event.payload.text,
text: text,
raw_message: event.payload,
direction: direction,
ts: this.knex.date.now()
Expand Down
4 changes: 2 additions & 2 deletions modules/hitl/src/views/full/message/index.jsx
Expand Up @@ -34,7 +34,7 @@ export default class Message extends React.Component {
renderContent() {
const type = this.props.content.type

if (type === 'message' || type === 'text') {
if (type === 'message' || type === 'text' || type === 'quick_reply' || type === 'custom') {
return this.renderText()
} else if (type === 'image') {
return this.renderImage()
Expand Down Expand Up @@ -75,7 +75,7 @@ export default class Message extends React.Component {
}

render() {
const renderedTypes = ['text', 'message', 'image', 'video', 'audio']
const renderedTypes = ['text', 'message', 'image', 'video', 'audio', 'quick_reply', 'custom']

if (!_.includes(renderedTypes, this.props.content.type)) {
return null
Expand Down

0 comments on commit b38d426

Please sign in to comment.