From f3a7d5f13ae42f1df8d7477da6763773c621b42f Mon Sep 17 00:00:00 2001 From: jvJUCA Date: Thu, 18 Apr 2024 13:30:02 -0300 Subject: [PATCH] fix: cant leave test because next() --- src/views/public/TestView.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/views/public/TestView.vue b/src/views/public/TestView.vue index 80af7750d..b219d6aba 100644 --- a/src/views/public/TestView.vue +++ b/src/views/public/TestView.vue @@ -512,6 +512,7 @@ export default { }, heurisIndex() { this.$refs.rightView.scrollTop = 0 //faz scroll pra cima qnd muda a heuristica + this.$forceUpdate() }, async user() { if (this.user) { @@ -547,16 +548,14 @@ export default { this.calculateProgress() }, beforeRouteLeave(to, from, next) { - if (this.test.userTestType === 'moderated') { + if (this.test && this.test.userTestType === 'moderated') { let isSaved = this.$refs.ModeratedTestView.isSaved() if (!isSaved) { if (!window.confirm('Leave without saving?')) { return - } - next() + } next() } else next() - next() - } + } next() }, methods: { startTest() {