Skip to content

Commit

Permalink
fix(UX): Freeze form while applying workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Feb 22, 2023
1 parent df4d3a2 commit db93700
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frappe/public/js/frappe/form/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ frappe.ui.form.States = Class.extend({
// set the workflow_action for use in form scripts
me.frm.selected_workflow_action = d.action;
me.frm.script_manager.trigger('before_workflow_action').then(() => {
frappe.dom.freeze();
frappe.xcall('frappe.model.workflow.apply_workflow',
{doc: me.frm.doc, action: d.action})
.then((doc) => {
frappe.dom.unfreeze();
frappe.model.sync(doc);
me.frm.refresh();
me.frm.selected_workflow_action = null;
Expand Down

0 comments on commit db93700

Please sign in to comment.