2021-07-09 07:50:54 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
assignableAgents() {
|
|
|
|
return this.$store.getters['inboxAssignableAgents/getAssignableAgents'](
|
|
|
|
this.inboxId
|
|
|
|
);
|
|
|
|
},
|
2021-11-15 11:52:44 +00:00
|
|
|
...mapGetters({ currentUser: 'getCurrentUser' }),
|
2021-07-22 11:01:53 +00:00
|
|
|
isAgentSelected() {
|
|
|
|
return this.currentChat?.meta?.assignee;
|
|
|
|
},
|
2021-07-09 07:50:54 +00:00
|
|
|
agentsList() {
|
|
|
|
const agents = this.assignableAgents || [];
|
|
|
|
return [
|
2021-07-22 11:01:53 +00:00
|
|
|
...(this.isAgentSelected
|
|
|
|
? [
|
|
|
|
{
|
|
|
|
confirmed: true,
|
|
|
|
name: 'None',
|
|
|
|
id: 0,
|
|
|
|
role: 'agent',
|
|
|
|
account_id: 0,
|
|
|
|
email: 'None',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2021-07-09 07:50:54 +00:00
|
|
|
...agents,
|
|
|
|
].map(item =>
|
|
|
|
item.id === this.currentUser.id
|
|
|
|
? {
|
|
|
|
...item,
|
|
|
|
availability_status: this.currentUser.availability_status,
|
|
|
|
}
|
|
|
|
: item
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|