Update redirects for teams.

This commit is contained in:
Mike Cao 2024-02-14 22:13:13 -08:00
parent 1955166bdf
commit f01073c46a
4 changed files with 26 additions and 7 deletions

View file

@ -10,10 +10,11 @@ export function TeamsButton({ teamId }: { teamId: string }) {
const { formatMessage, labels } = useMessages();
const { router } = useNavigation();
const team = user?.teams?.find(({ id }) => id === teamId);
const cloudMode = !!process.env.cloudMode;
const handleSelect = (close: () => void, id: Key) => {
if (id !== user.id) {
router.push(`/teams/${id}`);
router.push(cloudMode ? `${process.env.cloudUrl}/teams/${id}` : `/teams/${id}`);
} else {
router.push('/');
}