From f8bae897e5a1730f4c0fd17a3e680786dd9ae80e Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Wed, 26 Jul 2023 10:25:35 +0800 Subject: [PATCH] fix: switch workspace (#642) --- .../header/account-dropdown/workplace-selector/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.tsx b/web/app/components/header/account-dropdown/workplace-selector/index.tsx index 5abc9b32b1..6798bc4fa3 100644 --- a/web/app/components/header/account-dropdown/workplace-selector/index.tsx +++ b/web/app/components/header/account-dropdown/workplace-selector/index.tsx @@ -1,7 +1,6 @@ import { Fragment } from 'react' import { useContext } from 'use-context-selector' import { useTranslation } from 'react-i18next' -import { useRouter } from 'next/navigation' import { Menu, Transition } from '@headlessui/react' import cn from 'classnames' import s from './index.module.css' @@ -26,7 +25,6 @@ const itemCheckClassName = ` const WorkplaceSelector = () => { const { t } = useTranslation() - const router = useRouter() const { notify } = useContext(ToastContext) const { workspaces } = useWorkspacesContext() const currentWrokspace = workspaces.filter(item => item.current)?.[0] @@ -35,7 +33,7 @@ const WorkplaceSelector = () => { try { await switchWorkspace({ url: '/workspaces/switch', body: { tenant_id } }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) - router.replace('/apps') + location.assign(`${location.origin}`) } catch (e) { notify({ type: 'error', message: t('common.provider.saveFailed') })