mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: new preload pages (#3674)
This commit is contained in:
10
packages/env/src/blocksuite/index.ts
vendored
10
packages/env/src/blocksuite/index.ts
vendored
@@ -1,12 +1,8 @@
|
||||
import type { Page } from '@blocksuite/store';
|
||||
|
||||
export async function initPageWithPreloading(page: Page) {
|
||||
const workspace = page.workspace;
|
||||
const { data } = await import('@affine/templates/preloading.json');
|
||||
await page.waitForLoaded();
|
||||
await workspace.importPageSnapshot(data['space:hello-world'], page.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export async function initEmptyPage(page: Page) {
|
||||
await page.waitForLoaded();
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
|
||||
Reference in New Issue
Block a user