fix: Add an action cable events for label updates (#5694)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -252,6 +252,12 @@ const actions = {
|
||||
meta: { sender },
|
||||
} = conversation;
|
||||
commit(types.UPDATE_CONVERSATION, conversation);
|
||||
|
||||
dispatch('conversationLabels/setConversationLabel', {
|
||||
id: conversation.id,
|
||||
data: conversation.labels,
|
||||
});
|
||||
|
||||
dispatch('contacts/setContact', sender);
|
||||
},
|
||||
|
||||
|
||||
@@ -262,6 +262,8 @@ class Conversation < ApplicationRecord
|
||||
previous_labels, current_labels = previous_changes[:label_list]
|
||||
return unless (previous_labels.is_a? Array) && (current_labels.is_a? Array)
|
||||
|
||||
dispatcher_dispatch(CONVERSATION_UPDATED, previous_changes)
|
||||
|
||||
create_label_added(user_name, current_labels - previous_labels)
|
||||
create_label_removed(user_name, previous_labels - current_labels)
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class Conversations::EventDataPresenter < SimpleDelegator
|
||||
id: display_id,
|
||||
inbox_id: inbox_id,
|
||||
messages: push_messages,
|
||||
labels: label_list,
|
||||
meta: push_meta,
|
||||
status: status,
|
||||
custom_attributes: custom_attributes,
|
||||
|
||||
Reference in New Issue
Block a user