a2faa3484f
* 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>
44 lines
736 B
JavaScript
Executable file
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,
|
|
};
|