diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 6716999dcb..c80f64e6d9 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -1330,6 +1330,10 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } frappe.socketio.doctype_subscribe(this.doctype); frappe.realtime.on("list_update", (data) => { + if (data?.doctype !== this.doctype) { + return; + } + if (!frappe.get_doc(data?.doctype, data?.name)?.__unsaved) { frappe.model.remove_from_locals(data.doctype, data.name); } @@ -1345,9 +1349,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { process_document_refreshes() { if (!this.pending_document_refreshes.length) return; - const names = this.pending_document_refreshes - .filter((d) => d.doctype === this.doctype) - .map((d) => d.name); + const names = this.pending_document_refreshes.map((d) => d.name); this.pending_document_refreshes = this.pending_document_refreshes.filter( (d) => names.indexOf(d.name) === -1 );