2021-07-09 07:50:54 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
assignableAgents() {
|
|
|
|
return this.$store.getters['inboxAssignableAgents/getAssignableAgents'](
|
|
|
|
this.inboxId
|
|
|
|
);
|
|
|
|
},
|
|
|
|
...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
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|