fix: use .catch instead of second argument to then
This commit is contained in:
parent
bd672ddc37
commit
ffdf22065e
1 changed files with 6 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue