Skip to content

Commit

Permalink
clear quick replies from vuex action (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjona99 authored Mar 22, 2024
1 parent e050623 commit cee9e1a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/javascript/widget/store/modules/conversation/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,13 @@ export const actions = {
commit('clearConversations');
},

addOrUpdateMessage: async ({ commit }, data) => {
addOrUpdateMessage: async ({ commit, state }, data) => {
const { id, content_attributes } = data;
const { quickReplies } = state;
// If there are quick replies active, remove them before showing the new message
if (quickReplies.options.length > 0) {
commit('setQuickRepliesOptions', []);
}
if (content_attributes && content_attributes.deleted) {
commit('deleteMessage', id);
return;
Expand Down

0 comments on commit cee9e1a

Please sign in to comment.