From c58e33b1e92de2b1b348e99926c6a7d928199dfb Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Thu, 18 Nov 2021 16:03:42 +0100 Subject: [PATCH] Send module update upon result only once --- client/src/pages/module/module.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/pages/module/module.vue b/client/src/pages/module/module.vue index 5cd2a7fd..d00a547d 100644 --- a/client/src/pages/module/module.vue +++ b/client/src/pages/module/module.vue @@ -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', }; },