chore: remove reload listener from form

This commit is contained in:
phot0n 2022-11-12 15:16:05 +05:30
parent b21f9a5b26
commit 3dc376cd5c

View file

@ -397,8 +397,6 @@ frappe.ui.form.Form = class FrappeForm {
// set the doc
this.doc = frappe.get_doc(this.doctype, this.docname);
if (!this.doc.__islocal) this.setup_reload_listener();
// check permissions
this.fetch_permissions();
if (!this.has_read_permission()) {
@ -1979,19 +1977,6 @@ frappe.ui.form.Form = class FrappeForm {
});
}
setup_reload_listener() {
let doctype = this.doctype;
let docname = this.docname;
let listener_name = `reload_doc_${doctype}_${docname}`;
frappe.realtime.off(listener_name);
frappe.realtime.on(listener_name, () => {
if (frappe.get_route_str() === `Form/${doctype}/${docname}`) {
this.reload_doc();
}
});
}
// Filters fields from the reference doctype and sets them as options for a Select field
set_fields_as_options(
fieldname,