This commit is contained in:
2021-04-06 19:27:02 +00:00
parent 91cebab9d4
commit 4afb02c8cd
2 changed files with 35 additions and 9 deletions

View File

@@ -433,9 +433,11 @@ export default {
//STATE first if unlocking only
//if moving to another locked state this will block further updates below but we're accepting that
//and user can unlock first to finish updating
let stateSaved = false;
if (this.obj.isLockedAtServer) {
console.log("savestateFirst");
fail = await saveState(vm);
stateSaved = true;
}
//WOITEMS
@@ -444,16 +446,25 @@ export default {
//STATE last normally in case it locks
//or is completed
if (!this.obj.isLockedAtServer) {
if (!stateSaved && !fail && !this.obj.isLockedAtServer) {
fail = await saveState(vm);
}
//## ALL PARTIAL UPDATES SUCCEEDED
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
if (fail) {
//this assumes error is already displayed from save op
window.$gz.form.setFormState({
vm: vm,
dirty: true,
valid: false
});
} else {
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
}
//TODO: Nav to this again if it's a post