[fix] throttle running multiple times (#3962)
* [fix] throttle running multiple times * [fix] lint
This commit is contained in:
parent
0f63f8a889
commit
224a06eef7
1 changed files with 10 additions and 0 deletions
|
|
@ -364,6 +364,16 @@ frappe.views.QueryReport = Class.extend({
|
|||
}
|
||||
},
|
||||
refresh: function() {
|
||||
// throttle
|
||||
// stop refresh from being called multiple times (from triggers ?)
|
||||
if (!this.request_refresh) {
|
||||
this.request_refresh = setTimeout(() => {
|
||||
this._refresh();
|
||||
this.request_refresh = null;
|
||||
}, 300);
|
||||
}
|
||||
},
|
||||
_refresh: function() {
|
||||
// Run
|
||||
var me = this;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue