Skip to content

Commit

Permalink
Fixed conditions on chat widget message output
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaseduoli committed Jul 24, 2023
1 parent af0a73f commit 9ca0b43
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/chatWidget/chatWindow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,17 @@ export default function ChatWindow({
res.data.result &&
Object.keys(res.data.result).length > 0
) {
if (Object.keys(res.data.result).length === 1) {
if (chat_output_key &&
res.data.result[chat_output_key]) {
updateLastMessage({
message: Object.values(res.data.result)[0],
message: res.data.result[chat_output_key],
isSend: false,
});
} else if (
Object.keys(res.data.result).length > 1 &&
chat_output_key &&
res.data.result[chat_output_key]
Object.keys(res.data.result).length === 1
) {
updateLastMessage({
message: res.data.result[chat_output_key],
message: Object.values(res.data.result)[0],
isSend: false,
});
} else {
Expand Down

0 comments on commit 9ca0b43

Please sign in to comment.