Chatwoot/app/javascript/widget/store/modules/conversation/index.js
Nithin David Thomas a2faa3484f
feat: Add state and mutations for multiple conversation on widget (#2851)
* State structure

* How to refactr action modules

* feat: Add state and mutations for multiple conversation on widget

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2021-09-17 20:58:21 +05:30

44 lines
736 B
JavaScript
Executable file

import { getters } from './getters';
import { actions } from './actions';
import { mutations } from './mutations';
/* const state = {
conversations: {
byId: {},
allIds: [],
},
messages: {
byId: {},
allIds: [],
},
meta: {
byId: {
// 1: { allMessagesLoaded: false, isAgentTyping: false, isCreating: false },
},
},
uiFlags: {
isFetchingList: false,
},
activeConversationId: undefined
}; */
const state = {
conversations: {},
meta: {
userLastSeenAt: undefined,
},
uiFlags: {
allMessagesLoaded: false,
isFetchingList: false,
isAgentTyping: false,
isCreating: false,
},
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};