1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-23 18:34:02 +02:00

fix: don't re-.push() the URL if already on teamId (#3651)

This commit is contained in:
Paul Esch-Laurent 2022-08-11 10:23:08 -05:00 committed by GitHub
parent 19ef6533f6
commit c0a2207087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,7 +241,9 @@ export default class Plugin {
const currentTeamID = mmStore.getState().entities.teams.currentTeamId
if (currentTeamID && currentTeamID !== prevTeamID) {
if (prevTeamID && window.location.pathname.startsWith(windowAny.frontendBaseURL || '')) {
browserHistory.push(`/team/${currentTeamID}`)
// Don't re-push the URL if we're already on a URL for the current team
if (!window.location.pathname.startsWith(`${(windowAny.frontendBaseURL || '')}/team/${currentTeamID}`))
browserHistory.push(`/team/${currentTeamID}`)
}
prevTeamID = currentTeamID
store.dispatch(setTeam(currentTeamID))