mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 15:21:36 +03:00
fix: first workspace name (#1411)
This commit is contained in:
parent
6d435398e3
commit
75a7e2339c
@ -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) {
|
||||
|
2
packages/env/src/constant.ts
vendored
2
packages/env/src/constant.ts
vendored
@ -1,2 +1,2 @@
|
||||
export const DEFAULT_WORKSPACE_NAME = 'Untitled Workspace';
|
||||
export const DEFAULT_WORKSPACE_NAME = 'Demo Workspace';
|
||||
export const UNTITLED_WORKSPACE_NAME = 'Untitled';
|
||||
|
@ -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
|
||||
|
@ -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 }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user