diff --git a/src/components/sentence/SentenceCard.vue b/src/components/sentence/SentenceCard.vue index 02132544..9a366857 100644 --- a/src/components/sentence/SentenceCard.vue +++ b/src/components/sentence/SentenceCard.vue @@ -265,6 +265,7 @@ export default defineComponent({ computed: { ...mapWritableState(useProjectStore, ['diffMode', 'diffUserId', 'name']), ...mapWritableState(useGithubStore, ['reloadCommits']), + ...mapState(useTreesStore, ['reloadValidation']), ...mapState(useProjectStore, ['isValidator', 'blindAnnotationMode', 'shownMeta', 'languageDetected']), ...mapState(useUserStore, ['username']), ...mapState(useTagsStore, ['defaultTags']), @@ -320,16 +321,18 @@ export default defineComponent({ watch: { 'udValidation': { handler: function (newVal) { - for (const user of Object.keys(this.sentence.conlls)) { - if(newVal[user]) { - this.udValidationMsg[user] = newVal[user].message; - this.udValidationStatut[user] = 'negative' - } - else { - this.udValidationMsg[user] = ''; - this.udValidationStatut[user] = 'positive'; + if (this.reloadValidation) { + for (const user of Object.keys(this.sentence.conlls)) { + if(newVal[user]) { + this.udValidationMsg[user] = newVal[user].message; + this.udValidationStatut[user] = 'negative' + } + else { + this.udValidationMsg[user] = ''; + this.udValidationStatut[user] = 'positive'; + } } - } + } }, deep: true, }, diff --git a/src/pages/Sample.vue b/src/pages/Sample.vue index d2d71894..b913aa2b 100644 --- a/src/pages/Sample.vue +++ b/src/pages/Sample.vue @@ -99,7 +99,7 @@ export default defineComponent({ 'sortedSentIds' ]), ...mapState(useProjectStore, ['name']), - ...mapWritableState(useTreesStore, ['reloadTrees']), + ...mapWritableState(useTreesStore, ['reloadTrees', 'reloadValidation']), sampleName() { return this.$route.params.samplename as string; } @@ -117,6 +117,7 @@ export default defineComponent({ this.emptyPendingModification(); this.getTrees(); this.calculateHeight(); + this.reloadValidation = false; }, beforeUnmount() { window.removeEventListener('resize', this.calculateHeight); @@ -162,6 +163,7 @@ export default defineComponent({ this.udValidationPassed[sentId][userId] = userTreeValidation; } } + this.reloadValidation = true; }) .catch((error) => { notifyError({ error: error }); diff --git a/src/pinia/modules/trees/index.ts b/src/pinia/modules/trees/index.ts index 0049595b..3bbf6ef1 100644 --- a/src/pinia/modules/trees/index.ts +++ b/src/pinia/modules/trees/index.ts @@ -23,6 +23,7 @@ export const useTreesStore = defineStore('trees', { featuresSetForNotDiffs: [] as string[], selectedTags: [] as string[], reloadTrees: false as boolean, + reloadValidation: false as boolean, pendingModifications: new Map(), }; },