mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
Prevent browser 'Go Back' when you undesirably trying to go to previous page after sign in to your account
This commit is contained in:
@@ -188,7 +188,21 @@
|
||||
|
||||
// Listen for dragstart folder items
|
||||
events.$on('dragstart', (item) => this.draggedItem = item)
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
// Inquire user about his willing to step back to sign in page
|
||||
if (to.name === 'SignIn') {
|
||||
const answer = window.confirm('Do you really want to leave?')
|
||||
|
||||
if (answer) {
|
||||
next()
|
||||
} else {
|
||||
next(false)
|
||||
}
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user