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