Skip to content

Commit

Permalink
fix: cant leave test because next()
Browse files Browse the repository at this point in the history
  • Loading branch information
jvJUCA committed Apr 18, 2024
1 parent 68f543d commit f3a7d5f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/views/public/TestView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit f3a7d5f

Please sign in to comment.