mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: jump to index page after deletion (#3169)
(cherry picked from commit 37c8465af8)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { usePassiveWorkspaceEffect } from '@toeverything/hooks/use-block-suite-workspace';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Suspense, useCallback } from 'react';
|
||||
|
||||
import { getUIAdapter } from '../../../../adapters/workspace';
|
||||
@@ -13,6 +14,7 @@ export const WorkspaceSetting = ({ workspaceId }: { workspaceId: string }) => {
|
||||
usePassiveWorkspaceEffect(workspace.blockSuiteWorkspace);
|
||||
const setSettingModal = useSetAtom(openSettingModalAtom);
|
||||
const helper = useAppHelper();
|
||||
const router = useRouter();
|
||||
|
||||
const { NewSettingsDetail } = getUIAdapter(workspace.flavour);
|
||||
|
||||
@@ -20,8 +22,9 @@ export const WorkspaceSetting = ({ workspaceId }: { workspaceId: string }) => {
|
||||
async (id: string) => {
|
||||
await helper.deleteWorkspace(id);
|
||||
setSettingModal(prev => ({ ...prev, open: false, workspaceId: null }));
|
||||
router.push('/').catch(console.error);
|
||||
},
|
||||
[setSettingModal, helper]
|
||||
[helper, setSettingModal, router]
|
||||
);
|
||||
const onTransformWorkspace = useOnTransformWorkspace();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user