Import upstream patches from The Lounge (Feb 2024), bump version to v4.4.1-2 #2
@ -110,26 +110,23 @@ router.beforeEach((to, from, next) => {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from) => {
|
||||||
// Disallow navigating to non-existing routes
|
// Disallow navigating to non-existing routes
|
||||||
if (!to.matched.length) {
|
if (!to.matched.length) {
|
||||||
next(false);
|
return false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disallow navigating to invalid channels
|
// Disallow navigating to invalid channels
|
||||||
if (to.name === "RoutedChat" && !store.getters.findChannel(Number(to.params.id))) {
|
if (to.name === "RoutedChat" && !store.getters.findChannel(Number(to.params.id))) {
|
||||||
next(false);
|
return false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disallow navigating to invalid networks
|
// Disallow navigating to invalid networks
|
||||||
if (to.name === "NetworkEdit" && !store.getters.findNetwork(String(to.params.uuid))) {
|
if (to.name === "NetworkEdit" && !store.getters.findNetwork(String(to.params.uuid))) {
|
||||||
next(false);
|
return false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
router.afterEach((to) => {
|
router.afterEach((to) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user