fix: prohibit create first page besides local workspace (#1751)

This commit is contained in:
Himself65
2023-03-29 23:07:29 -05:00
committed by GitHub
parent 94d284d841
commit 14f073c8ea
2 changed files with 4 additions and 1 deletions

View File

@@ -35,6 +35,10 @@ const AllPage: NextPageWithLayout = () => {
if (!currentWorkspace) { if (!currentWorkspace) {
return; return;
} }
if (currentWorkspace.flavour !== WorkspaceFlavour.LOCAL) {
// only create a new page for local workspace
return;
}
const localProvider = currentWorkspace.providers.find( const localProvider = currentWorkspace.providers.find(
provider => provider.flavour === 'local-indexeddb' provider => provider.flavour === 'local-indexeddb'
); );

View File

@@ -20,7 +20,6 @@ test.describe('affine built in workspace', () => {
await page.getByText('Cloud Workspace').click(); await page.getByText('Cloud Workspace').click();
const page2 = await context.newPage(); const page2 = await context.newPage();
await openHomePage(page2); await openHomePage(page2);
await waitMarkdownImported(page2);
await loginUser(page2, b); await loginUser(page2, b);
await page2.reload(); await page2.reload();
await clickSideBarCurrentWorkspaceBanner(page2); await clickSideBarCurrentWorkspaceBanner(page2);