fix: Right click Snooze is not working (#9498)
This commit is contained in:
@@ -466,6 +466,10 @@ const actions = {
|
||||
commit(types.ASSIGN_PRIORITY, { priority, conversationId });
|
||||
},
|
||||
|
||||
setContextMenuChatId({ commit }, chatId) {
|
||||
commit(types.SET_CONTEXT_MENU_CHAT_ID, chatId);
|
||||
},
|
||||
|
||||
...messageReadActions,
|
||||
...messageTranslateActions,
|
||||
};
|
||||
|
||||
@@ -100,6 +100,10 @@ const getters = {
|
||||
getConversationLastSeen: _state => {
|
||||
return _state.conversationLastSeen;
|
||||
},
|
||||
|
||||
getContextMenuChatId: _state => {
|
||||
return _state.contextMenuChatId;
|
||||
},
|
||||
};
|
||||
|
||||
export default getters;
|
||||
|
||||
@@ -15,6 +15,7 @@ const state = {
|
||||
currentInbox: null,
|
||||
selectedChatId: null,
|
||||
appliedFilters: [],
|
||||
contextMenuChatId: null,
|
||||
conversationParticipants: [],
|
||||
conversationLastSeen: null,
|
||||
syncConversationsMessages: {},
|
||||
@@ -281,6 +282,10 @@ export const mutations = {
|
||||
) {
|
||||
_state.syncConversationsMessages[conversationId] = messageId;
|
||||
},
|
||||
|
||||
[types.SET_CONTEXT_MENU_CHAT_ID](_state, chatId) {
|
||||
_state.contextMenuChatId = chatId;
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
@@ -652,4 +652,11 @@ describe('#addMentions', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setContextMenuChatId', () => {
|
||||
it('sets the context menu chat id', () => {
|
||||
actions.setContextMenuChatId({ commit }, 1);
|
||||
expect(commit.mock.calls).toEqual([[types.SET_CONTEXT_MENU_CHAT_ID, 1]]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -272,4 +272,11 @@ describe('#getters', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getContextMenuChatId', () => {
|
||||
it('returns the context menu chat id', () => {
|
||||
const state = { contextMenuChatId: 1 };
|
||||
expect(getters.getContextMenuChatId(state)).toEqual(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -403,4 +403,12 @@ describe('#mutations', () => {
|
||||
expect(state.allConversations[0].attachments).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#SET_CONTEXT_MENU_CHAT_ID', () => {
|
||||
it('sets the context menu chat id', () => {
|
||||
const state = { contextMenuChatId: 1 };
|
||||
mutations[types.SET_CONTEXT_MENU_CHAT_ID](state, 2);
|
||||
expect(state.contextMenuChatId).toEqual(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user