From aa9ebc237fc162c1c98a9ff02cff4389bc539c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 29 Mar 2022 14:00:19 +0200 Subject: [PATCH] Fixing redirects on team change outside of boards (#2652) --- mattermost-plugin/webapp/src/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mattermost-plugin/webapp/src/index.tsx b/mattermost-plugin/webapp/src/index.tsx index 7cb715bfa..c66f3bf4b 100644 --- a/mattermost-plugin/webapp/src/index.tsx +++ b/mattermost-plugin/webapp/src/index.tsx @@ -189,8 +189,11 @@ export default class Plugin { if (currentTeamID && currentTeamID !== prevTeamID) { prevTeamID = currentTeamID store.dispatch(setTeam(currentTeamID)) - browserHistory.push(`/team/${currentTeamID}`) - wsClient.subscribeToTeam(currentTeamID) + if (window.location.pathname.startsWith(windowAny.frontendBaseURL || '')) { + console.log("REDIRECTING HERE") + browserHistory.push(`/team/${currentTeamID}`) + wsClient.subscribeToTeam(currentTeamID) + } } })