fix: Caller name in call popup
This commit is contained in:
parent
5ea6a5e33a
commit
eb0ca67ced
@ -98,7 +98,7 @@ class CallPopup {
|
|||||||
|
|
||||||
setup_known_caller(wrapper) {
|
setup_known_caller(wrapper) {
|
||||||
const contact = this.contact;
|
const contact = this.contact;
|
||||||
const contact_name = frappe.utils.get_form_link(contact.doctype, contact.name, true, contact.lead_name);
|
const contact_name = frappe.utils.get_form_link(contact.doctype, contact.name, true, this.get_caller_name());
|
||||||
const links = contact.links ? contact.links : [];
|
const links = contact.links ? contact.links : [];
|
||||||
|
|
||||||
let contact_links = '';
|
let contact_links = '';
|
||||||
@ -128,8 +128,7 @@ class CallPopup {
|
|||||||
let title = '';
|
let title = '';
|
||||||
call_status = call_status || this.call_log.status;
|
call_status = call_status || this.call_log.status;
|
||||||
if (['Ringing'].includes(call_status) || !call_status) {
|
if (['Ringing'].includes(call_status) || !call_status) {
|
||||||
title = __('Incoming call from {0}',
|
title = __('Incoming call from {0}', [this.get_caller_name()]);
|
||||||
[this.contact ? `${this.contact.first_name || ''} ${this.contact.last_name || ''}` : this.caller_number]);
|
|
||||||
this.set_indicator('blue', true);
|
this.set_indicator('blue', true);
|
||||||
} else if (call_status === 'In Progress') {
|
} else if (call_status === 'In Progress') {
|
||||||
title = __('Call Connected');
|
title = __('Call Connected');
|
||||||
@ -188,6 +187,9 @@ class CallPopup {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
get_caller_name() {
|
||||||
|
return this.contact ? this.contact.lead_name || this.contact.name || '' : this.caller_number;
|
||||||
|
}
|
||||||
setup_listener() {
|
setup_listener() {
|
||||||
frappe.realtime.on(`call_${this.call_log.id}_disconnected`, call_log => {
|
frappe.realtime.on(`call_${this.call_log.id}_disconnected`, call_log => {
|
||||||
this.call_disconnected(call_log);
|
this.call_disconnected(call_log);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user