Disallow navigating to invalid channels

This commit is contained in:
Richard Lewis 2019-11-08 12:56:18 +00:00 committed by Pavel Djundik
parent 5c0a7722a4
commit 897f238c38

View file

@ -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();