1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-07-12 23:50:27 +02:00

Fix the team highlight and the back to channels team selection (#3602)

This commit is contained in:
Jesús Espino
2022-08-08 19:01:51 +02:00
committed by GitHub
parent 32e584cbc5
commit d06936dc18
3 changed files with 9 additions and 13 deletions

View File

@ -252,10 +252,14 @@ export default class Plugin {
let fbPrevTeamID = store.getState().teams.currentId let fbPrevTeamID = store.getState().teams.currentId
store.subscribe(() => { store.subscribe(() => {
const currentTeamID = store.getState().teams.currentId const currentTeamID: string = store.getState().teams.currentId
if (currentTeamID && currentTeamID !== fbPrevTeamID) { const currentUserId = mmStore.getState().entities.users.currentUserId
if (currentTeamID !== fbPrevTeamID) {
fbPrevTeamID = currentTeamID fbPrevTeamID = currentTeamID
selectTeam(currentTeamID) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
mmStore.dispatch(selectTeam(currentTeamID))
localStorage.setItem(`user_prev_team:${currentUserId}`, currentTeamID)
} }
}) })
@ -380,11 +384,6 @@ export default class Plugin {
} }
} }
windowAny.setTeamInSidebar = (teamID: string) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
mmStore.dispatch(selectTeam(teamID))
}
windowAny.getCurrentTeamId = (): string => { windowAny.getCurrentTeamId = (): string => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore

View File

@ -30,6 +30,7 @@ import {
import {getCurrentViewId, setCurrent as setCurrentView} from '../../store/views' import {getCurrentViewId, setCurrent as setCurrentView} from '../../store/views'
import {initialLoad, initialReadOnlyLoad, loadBoardData} from '../../store/initialLoad' import {initialLoad, initialReadOnlyLoad, loadBoardData} from '../../store/initialLoad'
import {useAppSelector, useAppDispatch} from '../../store/hooks' import {useAppSelector, useAppDispatch} from '../../store/hooks'
import {setTeam} from '../../store/teams'
import {updateViews} from '../../store/views' import {updateViews} from '../../store/views'
import {updateCards} from '../../store/cards' import {updateCards} from '../../store/cards'
import {updateComments} from '../../store/comments' import {updateComments} from '../../store/comments'
@ -95,10 +96,7 @@ const BoardPage = (props: Props): JSX.Element => {
useEffect(() => { useEffect(() => {
UserSettings.lastTeamId = teamId UserSettings.lastTeamId = teamId
octoClient.teamId = teamId octoClient.teamId = teamId
const windowAny = (window as any) dispatch(setTeam(teamId))
if (windowAny.setTeamInSidebar) {
windowAny.setTeamInSidebar(teamId)
}
}, [teamId]) }, [teamId])
const loadAction: (boardId: string) => any = useMemo(() => { const loadAction: (boardId: string) => any = useMemo(() => {

View File

@ -16,7 +16,6 @@ export interface IAppWindow extends Window {
// window object when operating in // window object when operating in
// the Mattermost suite environment // the Mattermost suite environment
export type SuiteWindow = Window & { export type SuiteWindow = Window & {
setTeamInSidebar?: (teamID: string) => void
getCurrentTeamId?: () => string getCurrentTeamId?: () => string
baseURL?: string baseURL?: string
frontendBaseURL?: string frontendBaseURL?: string