Skip to content

Commit

Permalink
Merge pull request #126 from aplijobs/fix/add-await-to-dispatch
Browse files Browse the repository at this point in the history
Fix | Add await to dispatch action
  • Loading branch information
cmm-apli authored Mar 7, 2024
2 parents 20fac61 + a4c6cdf commit a439875
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascript/widget/components/AgentMessageBubble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ export default {
setCallback: 'conversation/setQuickRepliesCallback',
}),
async onOptionSelect(selectedOption) {
await this.$store.dispatch('message/update', {
submittedValues: [selectedOption],
messageId: this.messageId,
});
this.setOptions([]);
await this.sendMessage({content: selectedOption.title});
// Scroll to bottom once the quick reply is clicked
const container = document.getElementById('conversation-container');
container.scrollTo(0, container.scrollHeight);
Expand Down

0 comments on commit a439875

Please sign in to comment.