From ffdf22065ee00025d88ba6d18d6a3fcb19de1df6 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Mon, 9 Mar 2026 11:12:16 +0530 Subject: [PATCH] fix: use .catch instead of second argument to then --- .../custom/doctype/customize_form/customize_form.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frappe/custom/doctype/customize_form/customize_form.js b/frappe/custom/doctype/customize_form/customize_form.js index 2e0a93af4f..78e49939c0 100644 --- a/frappe/custom/doctype/customize_form/customize_form.js +++ b/frappe/custom/doctype/customize_form/customize_form.js @@ -101,8 +101,9 @@ frappe.ui.form.on("Customize Form", { frm.page.clear_icons(); if (frm.doc.doc_type) { - frappe.model.with_doctype(frm.doc.doc_type).then( - () => { + frappe.model + .with_doctype(frm.doc.doc_type) + .then(() => { frm.page.set_title(__("Customize Form - {0}", [__(frm.doc.doc_type)])); frappe.customize_form.set_primary_action(frm); @@ -164,12 +165,11 @@ frappe.ui.form.on("Customize Form", { render_form_builder(frm); frm.get_field("form_builder").tab.set_active(); - }, - () => { + }) + .catch(() => { frm.set_value("doc_type", ""); localStorage.removeItem("customize_doctype"); - } - ); + }); } frm.events.setup_export(frm);