Send module update upon result only once

This commit is contained in:
Christian Cueni 2021-11-18 16:03:42 +01:00
parent 013788a5bc
commit c58e33b1e9
1 changed files with 8 additions and 6 deletions

View File

@ -30,14 +30,13 @@
data() {
return {
module: {},
updateSent: false
};
},
created() {
this.$log.debug('**** module.vue created ****');
this.$log.debug(`||| module id ${this.module.id} |||`);
this.updateLastVisitedModule(this.module.id);
},
mounted() {
this.$log.debug('**** module.vue mounted ****');
@ -54,10 +53,13 @@
update(data) {
return this.$getRidOfEdges(data).module || {};
},
// result({data: {module: {id}}}) {
// this.$log.debug(`=== updating result for module ${id} ===`);
// this.updateLastVisitedModule(id);
// },
result({data: {module: {id}}}) {
if (!this.updateSent) {
this.$log.debug(`=== updating result for module ${id} ===`);
this.updateLastVisitedModule(id);
this.updateSent = true;
}
},
fetchPolicy: 'cache-first',
};
},