Disallow navigating to invalid networks

This commit is contained in:
Pavel Djundik 2020-07-20 11:49:53 +03:00
parent 181a198994
commit a2c1d1175b
1 changed files with 6 additions and 0 deletions

View File

@ -94,6 +94,12 @@ router.beforeEach((to, from, next) => {
return;
}
// Disallow navigating to invalid networks
if (to.name === "NetworkEdit" && !store.getters.findNetwork(to.params.uuid)) {
next(false);
return;
}
// Handle closing image viewer with the browser back button
if (!router.app.$refs.app) {
next();