feat: Ability to lock to single conversation (#5881)
Adds the ability to lock conversation to a single thread for Whatsapp and Sms Inboxes when using outbound messages. demo: https://www.loom.com/share/c9e1e563c8914837a4139dfdd2503fef fixes: #4975 Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
@@ -89,7 +89,19 @@ export const mutations = {
|
||||
},
|
||||
[types.default.ADD_CONTACT_CONVERSATION]: ($state, { id, data }) => {
|
||||
const conversations = $state.records[id] || [];
|
||||
Vue.set($state.records, id, [...conversations, data]);
|
||||
|
||||
const updatedConversations = [...conversations];
|
||||
const index = conversations.findIndex(
|
||||
conversation => conversation.id === data.id
|
||||
);
|
||||
|
||||
if (index !== -1) {
|
||||
updatedConversations[index] = { ...conversations[index], ...data };
|
||||
} else {
|
||||
updatedConversations.push(data);
|
||||
}
|
||||
|
||||
Vue.set($state.records, id, updatedConversations);
|
||||
},
|
||||
[types.default.DELETE_CONTACT_CONVERSATION]: ($state, id) => {
|
||||
Vue.delete($state.records, id);
|
||||
|
||||
Reference in New Issue
Block a user