fix:delete workspace will jump to 404

This commit is contained in:
DiamondThree
2023-02-07 20:01:25 +08:00
parent 028fdae8b1
commit d9d60197f2
3 changed files with 6 additions and 10 deletions
@@ -132,7 +132,6 @@ export const WorkspaceModal = ({ open, onClose }: WorkspaceModalProps) => {
onClose={async wait => {
if (!wait) {
await logout();
router.push(`/workspace`);
}
setLogoutOpen(false);
}}
@@ -11,7 +11,6 @@ import {
import { useState } from 'react';
import { ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
import { useRouter } from 'next/router';
import { WorkspaceUnit } from '@affine/datacenter';
import { Trans, useTranslation } from '@affine/i18n';
@@ -30,7 +29,6 @@ export const WorkspaceDelete = ({
}: WorkspaceDeleteProps) => {
const [deleteStr, setDeleteStr] = useState<string>('');
const { t } = useTranslation();
const router = useRouter();
const { deleteWorkSpace } = useWorkspaceHelper();
const handlerInputChange = (workspaceName: string) => {
setDeleteStr(workspaceName);
@@ -39,7 +37,6 @@ export const WorkspaceDelete = ({
const handleDelete = async () => {
await deleteWorkSpace();
onClose();
router.push(`/workspace`);
};
return (