From 75a7e2339cdef64f24e192b0f1b207c972765171 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Wed, 8 Mar 2023 01:44:50 -0600 Subject: [PATCH] fix: first workspace name (#1411) --- apps/web/src/hooks/use-blocksuite-workspace-name.ts | 4 ++-- packages/env/src/constant.ts | 2 +- tests/local-first-avatar.spec.ts | 2 +- tests/local-first-workspace.spec.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/src/hooks/use-blocksuite-workspace-name.ts b/apps/web/src/hooks/use-blocksuite-workspace-name.ts index 50449f9fa2..c375d42313 100644 --- a/apps/web/src/hooks/use-blocksuite-workspace-name.ts +++ b/apps/web/src/hooks/use-blocksuite-workspace-name.ts @@ -1,4 +1,4 @@ -import { DEFAULT_WORKSPACE_NAME } from '@affine/env'; +import { UNTITLED_WORKSPACE_NAME } from '@affine/env'; import { assertExists } from '@blocksuite/store'; import { useCallback, useEffect, useState } from 'react'; @@ -8,7 +8,7 @@ export function useBlockSuiteWorkspaceName( blockSuiteWorkspace: BlockSuiteWorkspace | null ) { const [name, set] = useState( - () => blockSuiteWorkspace?.meta.name ?? DEFAULT_WORKSPACE_NAME + () => blockSuiteWorkspace?.meta.name ?? UNTITLED_WORKSPACE_NAME ); useEffect(() => { if (blockSuiteWorkspace) { diff --git a/packages/env/src/constant.ts b/packages/env/src/constant.ts index c778a61a1f..9f2777f3b5 100644 --- a/packages/env/src/constant.ts +++ b/packages/env/src/constant.ts @@ -1,2 +1,2 @@ -export const DEFAULT_WORKSPACE_NAME = 'Untitled Workspace'; +export const DEFAULT_WORKSPACE_NAME = 'Demo Workspace'; export const UNTITLED_WORKSPACE_NAME = 'Untitled'; diff --git a/tests/local-first-avatar.spec.ts b/tests/local-first-avatar.spec.ts index 2da026a1c3..214d0eff2f 100644 --- a/tests/local-first-avatar.spec.ts +++ b/tests/local-first-avatar.spec.ts @@ -26,7 +26,7 @@ test.describe('Local first create page', () => { await page.waitForTimeout(1000); const text = await page.getByTestId('workspace-avatar').textContent(); // default avatar for default workspace - expect(text).toBe('U'); + expect(text).toBe('D'); await page.getByTestId('workspace-name').click(); await page.getByTestId('workspace-card').nth(1).click(); const blobUrl = await page diff --git a/tests/local-first-workspace.spec.ts b/tests/local-first-workspace.spec.ts index b6b5b0f21a..6f595ade72 100644 --- a/tests/local-first-workspace.spec.ts +++ b/tests/local-first-workspace.spec.ts @@ -8,7 +8,7 @@ loadPage(); test.describe('Local first default workspace', () => { test('preset workspace name', async ({ page }) => { const workspaceName = page.getByTestId('workspace-name'); - expect(await workspaceName.textContent()).toBe('Untitled Workspace'); + expect(await workspaceName.textContent()).toBe('Demo Workspace'); }); // test('default workspace avatar', async ({ page }) => {