mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:27:09 +00:00
Add dirty configuration flag
This commit is contained in:
@@ -440,6 +440,8 @@ export default {
|
||||
}
|
||||
],
|
||||
|
||||
dirty: false,
|
||||
|
||||
fileLoadDialog: false,
|
||||
|
||||
viewMode: 0,
|
||||
@@ -451,6 +453,18 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
configuration: {
|
||||
handler (cur, prev) {
|
||||
if (cur && prev) {
|
||||
this.dirty = true;
|
||||
} else {
|
||||
this.dirty = false;
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
active (cur, prev) {
|
||||
if (cur == prev) {
|
||||
return;
|
||||
@@ -548,6 +562,7 @@ export default {
|
||||
}
|
||||
};
|
||||
this.configuration = await this.api([url, init]);
|
||||
this.dirty = false;
|
||||
},
|
||||
|
||||
makeTree (obj, id=0) {
|
||||
@@ -605,7 +620,12 @@ export default {
|
||||
if (res && res.id == this.configuration.id) {
|
||||
// In case the server decided to apply any changes
|
||||
this.showSnack(["Configuration uploaded to server", "success"]);
|
||||
this.$nextTick( () => this.configuration = res );
|
||||
this.$nextTick( () => {
|
||||
this.configuration = res;
|
||||
this.$nextTick( () => {
|
||||
this.dirty = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user