fix: Resolve conversation with id instead of current conversation (#2731)

This commit is contained in:
Pranav Raj S
2021-08-02 13:11:07 +05:30
committed by GitHub
parent 9f3f238cb5
commit d88e3e3596
5 changed files with 54 additions and 8 deletions

View File

@@ -145,10 +145,10 @@ const actions = {
status,
snoozedUntil,
});
commit(
types.default.RESOLVE_CONVERSATION,
response.data.payload.current_status
);
commit(types.default.RESOLVE_CONVERSATION, {
conversationId,
status: response.data.payload.current_status,
});
} catch (error) {
// Handle error
}

View File

@@ -64,7 +64,9 @@ const getters = {
getChatStatusFilter: ({ chatStatusFilter }) => chatStatusFilter,
getSelectedInbox: ({ currentInbox }) => currentInbox,
getConversationById: _state => conversationId => {
return _state.allConversations.find(value => value.id === conversationId);
return _state.allConversations.find(
value => value.id === Number(conversationId)
);
},
};

View File

@@ -69,9 +69,10 @@ export const mutations = {
Vue.set(chat.meta, 'team', team);
},
[types.default.RESOLVE_CONVERSATION](_state, status) {
const [chat] = getSelectedChatConversation(_state);
chat.status = status;
[types.default.RESOLVE_CONVERSATION](_state, { conversationId, status }) {
const conversation =
getters.getConversationById(_state)(conversationId) || {};
Vue.set(conversation, 'status', status);
},
[types.default.MUTE_CONVERSATION](_state) {