Merge pull request #8627 from surajshetty3416/fix-clear-cache-issue
fix: Throttle clear cache
This commit is contained in:
commit
63eb588103
1 changed files with 8 additions and 11 deletions
|
|
@ -225,19 +225,16 @@ $.extend(frappe.ui.toolbar, {
|
|||
},
|
||||
});
|
||||
|
||||
frappe.ui.toolbar.clear_cache = function() {
|
||||
frappe.ui.toolbar.clear_cache = frappe.utils.throttle(function() {
|
||||
frappe.assets.clear_local_storage();
|
||||
frappe.call({
|
||||
method: 'frappe.sessions.clear',
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
frappe.show_alert({message:r.message, indicator:'green'});
|
||||
location.reload(true);
|
||||
}
|
||||
}
|
||||
frappe.xcall('frappe.sessions.clear').then(message => {
|
||||
frappe.show_alert({
|
||||
message: message,
|
||||
indicator: 'green'
|
||||
});
|
||||
location.reload(true);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
}, 10000);
|
||||
|
||||
frappe.ui.toolbar.show_about = function() {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue