feat: create workspace from loading existing exported file (#2122)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
Peng Xiao
2023-05-09 15:30:01 +08:00
committed by GitHub
parent 5432aae85c
commit 7c2574b1ca
93 changed files with 2999 additions and 1406 deletions

View File

@@ -97,14 +97,15 @@ const SettingPage: NextPageWithLayout = () => {
const helper = useAppHelper();
const onDeleteWorkspace = useCallback(() => {
const onDeleteWorkspace = useCallback(async () => {
assertExists(currentWorkspace);
const workspaceId = currentWorkspace.id;
if (workspaceIds.length === 1 && workspaceId === workspaceIds[0].id) {
toast(t['You cannot delete the last workspace']());
throw new Error('You cannot delete the last workspace');
} else {
return await helper.deleteWorkspace(workspaceId);
}
return helper.deleteWorkspace(workspaceId);
}, [currentWorkspace, helper, t, workspaceIds]);
const onTransformWorkspace = useOnTransformWorkspace();
if (!router.isReady) {