fix: first workspace create logic (#1773)

This commit is contained in:
Peng Xiao
2023-04-01 01:40:30 +08:00
committed by GitHub
parent fd65dd66a1
commit 7299efe16a
20 changed files with 158 additions and 87 deletions
+4
View File
@@ -1,3 +1,4 @@
import { DebugLogger } from '@affine/debug';
import { jotaiWorkspacesAtom } from '@affine/workspace/atom';
import type { LocalWorkspace } from '@affine/workspace/type';
import { WorkspaceFlavour } from '@affine/workspace/type';
@@ -15,6 +16,8 @@ export function useWorkspaces(): AllWorkspace[] {
return useAtomValue(workspacesAtom);
}
const logger = new DebugLogger('use-workspaces');
export function useWorkspacesHelper() {
const workspaces = useWorkspaces();
const jotaiWorkspaces = useAtomValue(jotaiWorkspacesAtom);
@@ -48,6 +51,7 @@ export function useWorkspacesHelper() {
flavour: WorkspaceFlavour.LOCAL,
},
]);
logger.debug('created local workspace', id);
return id;
},
[set]