fix: freeze screen while pulling emails

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
Sumit Bhanushali 2024-07-11 11:31:33 +05:30 committed by GitHub
parent 928428c6a7
commit 5c1e0c2bc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,11 +157,12 @@ frappe.ui.form.on("Email Account", {
if (!frm.is_dirty() && frm.doc.enable_incoming) {
frm.add_custom_button(__("Pull Emails"), () => {
frappe.show_alert({ message: __("Pulling Emails..."), indicator: "blue" });
frappe.dom.freeze(__('Pulling emails...'));
frm.call({
method: "pull_emails",
args: { email_account: frm.doc.name },
}).then(() => {
frappe.dom.unfreeze();
frappe.show_alert({ message: __("Emails Pulled"), indicator: "green" });
});
});