diff --git a/README.md b/README.md index f7c168ad7f..50c429c533 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066 ![952cd7a5-70fe-48ab-b74f-23981d94d2c5](https://user-images.githubusercontent.com/79301703/182365526-df074c64-cee4-45f6-b8e0-b912f17332c6.gif) # How to use +

🥳🥳🥳 Our web live demo is ready! 🥳🥳🥳

@@ -63,7 +64,7 @@ Start to play with AFFiNE web version on />

-If you have experience in front-end development, you may wish to refer to our [documentation](https://docs.affine.pro/affine/basic-documentation/contribute-to-affine) to learn more about deploying your own version or contributing further to development. +If you have experience in front-end development, you may wish to refer to our [documentation](https://docs.affine.pro/affine/basic-documentation/contribute-to-affine) to learn more about deploying your own version or contributing further to development. Also, thanks to Lee who has made a [desktop build with Tauri](https://github.com/m1911star/affine-client) for you to try out. Please notice that AFFiNE is still under Alpha stage and is not ready for production use. diff --git a/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx b/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx index 67a36e1cee..6769ed2889 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx @@ -92,18 +92,16 @@ export const WorkspaceName = () => { const { fixedDisplay, toggleSpaceSidebar } = useShowSpaceSidebar(); const [inRename, setInRename] = useState(false); const [workspaceName, setWorkspaceName] = useState(''); - const [workspaceId, setWorkspaceId] = useState(''); const fetchWorkspaceName = useCallback(async () => { if (!currentSpaceId) { return; } - const [name, workspaceId] = await Promise.all([ - services.api.userConfig.getWorkspaceName(currentSpaceId), - services.api.userConfig.getWorkspaceId(currentSpaceId), - ]); + const name = await services.api.userConfig.getWorkspaceName( + currentSpaceId + ); + setWorkspaceName(name); - setWorkspaceId(workspaceId); }, [currentSpaceId]); useEffect(() => { @@ -180,7 +178,7 @@ export const WorkspaceName = () => { ) : ( setInRename(true)}> - {workspaceName || workspaceId} + {workspaceName || currentSpaceId} )} diff --git a/libs/datasource/db-service/src/services/workspace/user-config.ts b/libs/datasource/db-service/src/services/workspace/user-config.ts index 887bb1ec2a..277c3473c7 100644 --- a/libs/datasource/db-service/src/services/workspace/user-config.ts +++ b/libs/datasource/db-service/src/services/workspace/user-config.ts @@ -114,11 +114,6 @@ export class UserConfig extends ServiceBaseClass { return workspaceName; } - async getWorkspaceId(workspace: string): Promise { - const workspaceDbBlock = await this.getWorkspaceDbBlock(workspace); - return workspaceDbBlock.id; - } - async setWorkspaceName(workspace: string, workspaceName: string) { const workspaceDbBlock = await this.getWorkspaceDbBlock(workspace); workspaceDbBlock.setDecoration(WORKSPACE_CONFIG, workspaceName); diff --git a/libs/utils/src/utils.ts b/libs/utils/src/utils.ts index 4388128e92..28adc6c4d8 100644 --- a/libs/utils/src/utils.ts +++ b/libs/utils/src/utils.ts @@ -5,15 +5,6 @@ export function getUserDisplayName(user?: UserInfo) { return nickname || username || email || 'Unknown User'; } -/** - * Get workspace_id from URL - * @returns workspace_id - */ -export function getWorkspaceId() { - const path = window.location.pathname.match(/\/(\w+)\//); - return path ? path[1] : undefined; -} - /** * Get page_id from URL * @returns page_id