mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 04:27:53 +00:00
fix: TypeError cannot read properties of undefined (reading 'name') (#9562)
This commit is contained in:
@@ -64,17 +64,19 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableData() {
|
tableData() {
|
||||||
return this.agentMetrics.map(agent => {
|
return this.agentMetrics
|
||||||
const agentInformation = this.getAgentInformation(agent.id);
|
.filter(agentMetric => this.getAgentInformation(agentMetric.id))
|
||||||
return {
|
.map(agent => {
|
||||||
agent: agentInformation.name,
|
const agentInformation = this.getAgentInformation(agent.id);
|
||||||
email: agentInformation.email,
|
return {
|
||||||
thumbnail: agentInformation.thumbnail,
|
agent: agentInformation.name || agentInformation.available_name,
|
||||||
open: agent.metric.open || 0,
|
email: agentInformation.email,
|
||||||
unattended: agent.metric.unattended || 0,
|
thumbnail: agentInformation.thumbnail,
|
||||||
status: agentInformation.availability_status,
|
open: agent.metric.open || 0,
|
||||||
};
|
unattended: agent.metric.unattended || 0,
|
||||||
});
|
status: agentInformation.availability_status,
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
columns() {
|
columns() {
|
||||||
return [
|
return [
|
||||||
@@ -130,7 +132,7 @@ export default {
|
|||||||
this.$emit('page-change', pageIndex);
|
this.$emit('page-change', pageIndex);
|
||||||
},
|
},
|
||||||
getAgentInformation(id) {
|
getAgentInformation(id) {
|
||||||
return this.agents.find(agent => agent.id === Number(id));
|
return this.agents?.find(agent => agent.id === Number(id));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user