From ab52f39b9433f812b42eaa9bed436b0f7ce70a64 Mon Sep 17 00:00:00 2001 From: Alex Leach Date: Sun, 4 Jan 2026 04:27:57 +0000 Subject: [PATCH] refactor: consolidate CommunicationComposer get_content_field method --- frappe/public/js/frappe/views/communication.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 05b32f1781..70ac07a94f 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -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() || ""; }