This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user