refactor: consolidate CommunicationComposer get_content_field method

This commit is contained in:
Alex Leach 2026-01-04 04:27:57 +00:00
parent e8d1d40ff1
commit ab52f39b94
No known key found for this signature in database
GPG key ID: CBB1F1542760286C

View file

@ -260,10 +260,11 @@ frappe.views.CommunicationComposer = class {
}
get_content_field() {
const content_field = this.dialog.fields_dict.use_html.value
? this.dialog.fields_dict.html_content
: this.dialog.fields_dict.content;
return content_field;
if (this.dialog.fields_dict.use_html.value) {
return this.dialog.fields_dict.html_content;
} else {
return this.dialog.fields_dict.content;
}
}
get_default_recipients(fieldname) {
@ -1068,11 +1069,6 @@ frappe.views.CommunicationComposer = class {
return text.replace(/\n{3,}/g, "\n\n");
}
get_content_field() {
const use_html = this.dialog.get_value("use_html");
return use_html ? this.dialog.fields_dict.content_html : this.dialog.fields_dict.content;
}
get_email_content() {
return this.get_content_field().get_value() || "";
}