From 0c49f025b4c0c4a0ace54e588bd30d0829cb8e99 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Sat, 23 Nov 2019 15:18:44 +0000 Subject: [PATCH] Fix Vue error when navigating to channels via InlineChannel. --- client/js/router.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/js/router.js b/client/js/router.js index 469d7e4b..304d91b9 100644 --- a/client/js/router.js +++ b/client/js/router.js @@ -64,7 +64,7 @@ router.beforeEach((to, from, next) => { next(); }); -router.afterEach(() => { +router.afterEach((to) => { if (store.state.appLoaded) { if (window.innerWidth <= constants.mobileViewportPixels) { store.commit("sidebarOpen", false); @@ -73,7 +73,10 @@ router.afterEach(() => { if (store.state.activeChannel) { const channel = store.state.activeChannel.channel; - store.commit("activeChannel", null); + + if (to.name !== "RoutedChat") { + store.commit("activeChannel", null); + } // When switching out of a channel, mark everything as read if (channel.messages.length > 0) {