diff --git a/mattermost-plugin/webapp/src/index.tsx b/mattermost-plugin/webapp/src/index.tsx index 35d06650064..86f1a35f16b 100644 --- a/mattermost-plugin/webapp/src/index.tsx +++ b/mattermost-plugin/webapp/src/index.tsx @@ -249,6 +249,15 @@ export default class Plugin { } }) + let fbPrevTeamID = store.getState().teams.currentId + store.subscribe(() => { + const currentTeamID = store.getState().teams.currentId + if (currentTeamID && currentTeamID !== fbPrevTeamID) { + fbPrevTeamID = currentTeamID + selectTeam(currentTeamID) + } + }) + if (this.registry.registerProduct) { windowAny.frontendBaseURL = subpath + '/boards'