diff --git a/components/dashboard/src/Menu.tsx b/components/dashboard/src/Menu.tsx index 42c3c8c39a2b7a..41bb27b29869ed 100644 --- a/components/dashboard/src/Menu.tsx +++ b/components/dashboard/src/Menu.tsx @@ -33,7 +33,6 @@ export default function Menu() { const { user } = useContext(UserContext); const { teams } = useContext(TeamsContext); const location = useLocation(); - const visibleTeams = teams?.filter(team => { return Boolean(!team.markedDeleted) }); const match = useRouteMatch<{ segment1?: string, segment2?: string, segment3?: string }>("/(t/)?:segment1/:segment2?/:segment3?"); const projectName = (() => { @@ -192,7 +191,7 @@ export default function Menu() { separator: true, link: '/', }, - ...(visibleTeams || []).map(t => ({ + ...(teams || []).map(t => ({ title: t.name, customContent:
{t.name} diff --git a/components/gitpod-db/src/typeorm/team-db-impl.ts b/components/gitpod-db/src/typeorm/team-db-impl.ts index c88dea2f4e00f3..7778405b309766 100644 --- a/components/gitpod-db/src/typeorm/team-db-impl.ts +++ b/components/gitpod-db/src/typeorm/team-db-impl.ts @@ -76,7 +76,7 @@ export class TeamDBImpl implements TeamDB { public async findTeamById(teamId: string): Promise { const teamRepo = await this.getTeamRepo(); - return teamRepo.findOne({ id: teamId, deleted: false }); + return teamRepo.findOne({ id: teamId, deleted: false, markedDeleted: false}); } public async findMembersByTeam(teamId: string): Promise { @@ -123,7 +123,7 @@ export class TeamDBImpl implements TeamDB { throw new Error('A team cannot have the same name as an existing user'); } const teamRepo = await this.getTeamRepo(); - const existingTeam = await teamRepo.findOne({ slug, deleted: false }); + const existingTeam = await teamRepo.findOne({ slug, deleted: false, markedDeleted: false }); if (!!existingTeam) { throw new Error('A team with this name already exists'); }