mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-01 14:19:40 +08:00
fix: delete workspace in settings (#3030)
(cherry picked from commit dec0c0d3d1)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import React, { Suspense, useCallback } from 'react';
|
||||
import { Suspense, useCallback } from 'react';
|
||||
|
||||
import { getUIAdapter } from '../../../../adapters/workspace';
|
||||
import { useOnTransformWorkspace } from '../../../../hooks/root/use-on-transform-workspace';
|
||||
@@ -10,11 +9,12 @@ export const WorkSpaceSetting = ({ workspace }: { workspace: Workspace }) => {
|
||||
const helper = useAppHelper();
|
||||
const { NewSettingsDetail } = getUIAdapter(workspace.flavour);
|
||||
|
||||
const onDeleteWorkspace = useCallback(async () => {
|
||||
assertExists(currentWorkspace);
|
||||
const workspaceId = currentWorkspace.id;
|
||||
return helper.deleteWorkspace(workspaceId);
|
||||
}, [helper]);
|
||||
const onDeleteWorkspace = useCallback(
|
||||
async (id: string) => {
|
||||
return helper.deleteWorkspace(id);
|
||||
},
|
||||
[helper]
|
||||
);
|
||||
const onTransformWorkspace = useOnTransformWorkspace();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user