fix: actually debounce list view updates (#21738)
Immediately debouncing and executing creates a new function everytime and doesn't actually "debounce" it just "delays". 🗿
[skip ci]
This commit is contained in:
parent
453892cdef
commit
c2a5adadbe
1 changed files with 5 additions and 1 deletions
|
|
@ -24,6 +24,10 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
constructor(opts) {
|
||||
super(opts);
|
||||
this.show();
|
||||
this.debounced_refresh = frappe.utils.debounce(
|
||||
this.process_document_refreshes.bind(this),
|
||||
2000
|
||||
);
|
||||
}
|
||||
|
||||
has_permissions() {
|
||||
|
|
@ -1377,7 +1381,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
}
|
||||
|
||||
this.pending_document_refreshes.push(data);
|
||||
frappe.utils.debounce(this.process_document_refreshes.bind(this), 1000)();
|
||||
this.debounced_refresh();
|
||||
});
|
||||
this.realtime_events_setup = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue