1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-03-20 20:45:00 +02:00

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

This commit is contained in:
Jesús Espino 2022-08-08 19:01:51 +02:00 committed by GitHub
parent 32e584cbc5
commit d06936dc18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 13 deletions
mattermost-plugin/webapp/src
webapp/src
pages/boardPage
types

@ -252,10 +252,14 @@ export default class Plugin {
let fbPrevTeamID = store.getState().teams.currentId
store.subscribe(() => {
const currentTeamID = store.getState().teams.currentId
if (currentTeamID && currentTeamID !== fbPrevTeamID) {
const currentTeamID: string = store.getState().teams.currentId
const currentUserId = mmStore.getState().entities.users.currentUserId
if (currentTeamID !== fbPrevTeamID) {
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 => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

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

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