Merge pull request #3803 from imsyedabdullah/3802-team-to-user-switch

Issue#3802 - Team to user switch fixed
This commit is contained in:
Mike Cao 2025-12-01 23:15:00 -08:00 committed by GitHub
commit 06251e1317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -1,8 +1,9 @@
'use client';
import { redirect } from 'next/navigation';
import { getItem } from '@/lib/storage';
import { useEffect } from 'react';
import { LAST_TEAM_CONFIG } from '@/lib/constants';
import { getItem, removeItem } from '@/lib/storage';
import { getItem } from '@/lib/storage';
export default function RootPage() {
useEffect(() => {
@ -11,8 +12,6 @@ export default function RootPage() {
if (lastTeam) {
redirect(`/teams/${lastTeam}/websites`);
} else {
removeItem(LAST_TEAM_CONFIG);
redirect(`/websites`);
}
}, []);

View file

@ -93,7 +93,7 @@ export function NavButton({ showText = true }: TeamsButtonProps) {
<Column minWidth="300px">
<Menu selectionMode="single" selectedKeys={selectedKeys}>
<MenuSection title={formatMessage(labels.myAccount)}>
<MenuItem id="user" href={getUrl('/')}>
<MenuItem id="user" href={getUrl('/websites')}>
<IconLabel icon={<User />} label={user.username} />
</MenuItem>
</MenuSection>