mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Disallow navigating to invalid channels
This commit is contained in:
parent
5c0a7722a4
commit
897f238c38
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,12 @@ router.beforeEach((to, from, next) => {
|
|||
return;
|
||||
}
|
||||
|
||||
// Disallow navigating to invalid channels
|
||||
if (to.name === "RoutedChat" && !store.getters.findChannel(Number(to.params.pathMatch))) {
|
||||
next(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle closing image viewer with the browser back button
|
||||
if (!router.app.$refs.app) {
|
||||
next();
|
||||
|
|
Loading…
Reference in a new issue