mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 05:16:13 +03:00
fix:delete bugs
This commit is contained in:
parent
855ad54fe1
commit
2773b3e489
@ -8,13 +8,16 @@ export const WorkspaceSelector = () => {
|
||||
const [workspaceListShow, setWorkspaceListShow] = useState(false);
|
||||
const [workspace, setWorkSpace] = useState(getActiveWorkspace());
|
||||
useEffect(() => {
|
||||
getWorkspace();
|
||||
setWorkspace();
|
||||
}, [workspaceListShow]);
|
||||
const workspaceList = getWorkspaces();
|
||||
if (workspaceList.length === 0) {
|
||||
setWorkspaceListShow(true);
|
||||
}
|
||||
const getWorkspace = () => {
|
||||
useEffect(() => {
|
||||
const workspaceList = getWorkspaces();
|
||||
if (workspaceList.length === 0) {
|
||||
setWorkspaceListShow(true);
|
||||
}
|
||||
});
|
||||
|
||||
const setWorkspace = () => {
|
||||
const workspace = getActiveWorkspace();
|
||||
setWorkSpace(workspace);
|
||||
};
|
||||
@ -42,7 +45,7 @@ export const WorkspaceSelector = () => {
|
||||
open={workspaceListShow}
|
||||
onClose={() => {
|
||||
setWorkspaceListShow(false);
|
||||
getWorkspace();
|
||||
setWorkspace();
|
||||
}}
|
||||
></WorkspaceModal>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user