fix:delete bugs

This commit is contained in:
DiamondThree 2023-01-05 19:07:14 +08:00
parent 855ad54fe1
commit 2773b3e489

View File

@ -8,13 +8,16 @@ export const WorkspaceSelector = () => {
const [workspaceListShow, setWorkspaceListShow] = useState(false); const [workspaceListShow, setWorkspaceListShow] = useState(false);
const [workspace, setWorkSpace] = useState(getActiveWorkspace()); const [workspace, setWorkSpace] = useState(getActiveWorkspace());
useEffect(() => { useEffect(() => {
getWorkspace(); setWorkspace();
}, [workspaceListShow]); }, [workspaceListShow]);
const workspaceList = getWorkspaces(); useEffect(() => {
if (workspaceList.length === 0) { const workspaceList = getWorkspaces();
setWorkspaceListShow(true); if (workspaceList.length === 0) {
} setWorkspaceListShow(true);
const getWorkspace = () => { }
});
const setWorkspace = () => {
const workspace = getActiveWorkspace(); const workspace = getActiveWorkspace();
setWorkSpace(workspace); setWorkSpace(workspace);
}; };
@ -42,7 +45,7 @@ export const WorkspaceSelector = () => {
open={workspaceListShow} open={workspaceListShow}
onClose={() => { onClose={() => {
setWorkspaceListShow(false); setWorkspaceListShow(false);
getWorkspace(); setWorkspace();
}} }}
></WorkspaceModal> ></WorkspaceModal>
</> </>