feat: Split reconnect logic PR (store) (#9520)

# Pull Request Template

## Description

This PR includes store filter parts split from this [Reconnect
PR](https://github.com/chatwoot/chatwoot/pull/9453)
This commit is contained in:
Sivin Varghese
2024-05-30 12:29:55 +05:30
committed by GitHub
parent 6c682a6869
commit e3eca47c31
22 changed files with 374 additions and 20 deletions

View File

@@ -9,6 +9,7 @@ export const state = {
isCreating: false,
isDeleting: false,
},
activeConversationFolder: null,
};
export const getters = {
@@ -21,6 +22,9 @@ export const getters = {
getCustomViewsByFilterType: _state => filterType => {
return _state.records.filter(record => record.filter_type === filterType);
},
getActiveConversationFolder(_state) {
return _state.activeConversationFolder;
},
};
export const actions = {
@@ -71,6 +75,9 @@ export const actions = {
commit(types.SET_CUSTOM_VIEW_UI_FLAG, { isDeleting: false });
}
},
setActiveConversationFolder({ commit }, data) {
commit(types.SET_ACTIVE_CONVERSATION_FOLDER, data);
},
};
export const mutations = {
@@ -85,6 +92,10 @@ export const mutations = {
[types.SET_CUSTOM_VIEW]: MutationHelpers.set,
[types.UPDATE_CUSTOM_VIEW]: MutationHelpers.update,
[types.DELETE_CUSTOM_VIEW]: MutationHelpers.destroy,
[types.SET_ACTIVE_CONVERSATION_FOLDER](_state, folder) {
_state.activeConversationFolder = folder;
},
};
export default {