feat:add loadWorkspace

This commit is contained in:
DiamondThree
2023-01-09 18:46:36 +08:00
parent 5687fa211e
commit bf61fbc057
3 changed files with 16 additions and 13 deletions
@@ -7,12 +7,10 @@ import { KeyboardEvent } from 'react';
import { useTranslation } from 'react-i18next';
import { useAppState } from '@/providers/app-state-provider';
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
interface ICloseParams {
workspaceId?: string;
}
interface ModalProps {
open: boolean;
onClose: (opts: ICloseParams) => void;
onClose: () => void;
}
export const CreateWorkspaceModal = ({ open, onClose }: ModalProps) => {
@@ -23,6 +21,7 @@ export const CreateWorkspaceModal = ({ open, onClose }: ModalProps) => {
const workspace = await createWorkspace(workspaceName);
if (workspace && workspace.room) {
await loadWorkspace(workspace.room);
onClose();
} else {
console.log('create error');
}
@@ -44,7 +43,7 @@ export const CreateWorkspaceModal = ({ open, onClose }: ModalProps) => {
top={6}
right={6}
onClick={() => {
onClose({});
onClose();
}}
/>
</Header>