feat: Allow users to mark a conversation as unread (#5924)

Allow users to mark conversations as unread.
Loom video: https://www.loom.com/share/ab70552d3c9c48b685da7dfa64be8bb3

fixes: #5552

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Sojan Jose
2022-11-24 07:55:45 +00:00
committed by GitHub
parent e593e516b8
commit 606fc9046a
20 changed files with 190 additions and 48 deletions

View File

@@ -8,7 +8,7 @@ import {
buildConversationList,
isOnMentionsView,
} from './helpers/actionHelpers';
import messageReadActions from './actions/messageReadActions';
// actions
const actions = {
getConversation: async ({ commit }, conversationId) => {
@@ -257,17 +257,6 @@ const actions = {
dispatch('contacts/setContact', sender);
},
markMessagesRead: async ({ commit }, data) => {
try {
const {
data: { id, agent_last_seen_at: lastSeen },
} = await ConversationApi.markMessageRead(data);
setTimeout(() => commit(types.MARK_MESSAGE_READ, { id, lastSeen }), 4000);
} catch (error) {
// Handle error
}
},
setChatFilter({ commit }, data) {
commit(types.CHANGE_CHAT_STATUS_FILTER, data);
},
@@ -336,6 +325,7 @@ const actions = {
clearConversationFilters({ commit }) {
commit(types.CLEAR_CONVERSATION_FILTERS);
},
...messageReadActions,
};
export default actions;