refactor: updated watch condition

This commit is contained in:
Shubh Doshi 2026-02-26 13:12:43 +05:30
parent 26cb0c1622
commit 81bb823427

View file

@ -9,8 +9,9 @@ let title = ref("Workflow Details");
watch(
() => store.workflow_doc?.document_type,
async (newDocType, oldDocType) => {
if (newDocType && oldDocType && newDocType !== oldDocType) {
await store.update_is_submittable();
if (!newDocType) return;
await store.update_is_submittable();
if (newDocType !== oldDocType) {
store.reset_non_submittable_states();
}
}