Skip to content

Commit

Permalink
feat: added confirmation dialog on father component because is a bug …
Browse files Browse the repository at this point in the history
…of vue router
  • Loading branch information
jvJUCA committed Apr 16, 2024
1 parent e976d93 commit 9f106eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/views/public/TestView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,14 @@ export default {
this.populateWithHeuristicQuestions()
this.calculateProgress()
},
beforeRouteLeave(to, from, next) {
if (this.test.userTestType === 'moderated') {
if (!window.confirm('Leave without saving?')) {
return
}
next()
} else next()
},
methods: {
startTest() {
if (this.test.testStructure.length == 0) {
Expand Down

0 comments on commit 9f106eb

Please sign in to comment.