Force exit of Error view if no error is provided

This commit is contained in:
Bubka 2021-11-06 11:34:05 +01:00
parent 0383f07ad7
commit 0f17d93152

View File

@ -47,8 +47,8 @@
}, },
error: function() { error: function() {
if( this.err === undefined ) { if( this.err == null ) {
return null return false
} }
else else
{ {
@ -66,7 +66,7 @@
}, },
props: ['err'], // error.response props: ['err'], // on object (error.response) or a string
components: { components: {
Modal Modal
@ -78,7 +78,18 @@
this.$router.push({name: 'accounts' }); this.$router.push({name: 'accounts' });
}); });
} },
beforeRouteEnter (to, from, next) {
next(vm => {
if( !vm.err ) {
next({ name: 'accounts' });
}
});
next();
},
} }
</script> </script>