diff --git a/client/js/router.js b/client/js/router.js index 304d91b9..aaf7071b 100644 --- a/client/js/router.js +++ b/client/js/router.js @@ -127,7 +127,14 @@ function initialize() { } function navigate(routeName, params = {}) { - router.push({name: routeName, params}).catch(() => {}); + if (router.currentRoute.name) { + router.push({name: routeName, params}).catch(() => {}); + } else { + // If current route is null, replace the history entry + // This prevents invalid entries from lingering in history, + // and then the route guard preventing proper navigation + router.replace({name: routeName, params}).catch(() => {}); + } } function switchToChannel(channel) { diff --git a/client/js/vue.js b/client/js/vue.js index be23984b..7f024ec7 100644 --- a/client/js/vue.js +++ b/client/js/vue.js @@ -71,9 +71,8 @@ store.watch( (sidebarOpen) => { if (window.outerWidth > constants.mobileViewportPixels) { storage.set("thelounge.state.sidebar", sidebarOpen); + vueApp.$emit("resize"); } - - vueApp.$emit("resize"); } );