Fix Error view not being displayed while an error exists

This commit is contained in:
Bubka
2023-11-21 15:06:49 +01:00
parent 73b2c60311
commit 9c818c69c5
2 changed files with 9 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
export default function noEmptyError({ to, next, nextMiddleware }) {
if (to.params.err == undefined) {
// return to home if no err object is provided to prevent an empty error message
export default function noEmptyError({ to, next, nextMiddleware, stores }) {
const { notify } = stores
if (notify.err == null) {
// return to home if no err object is set to prevent an empty error message
next({ name: 'accounts' });
}
else nextMiddleware()