mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 01:29:31 +08:00
feat: bump blocksuite (#5845)
This commit is contained in:
@@ -22,9 +22,9 @@ beforeEach(async () => {
|
||||
id: 'test',
|
||||
schema,
|
||||
});
|
||||
await initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page0' }));
|
||||
await initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page1' }));
|
||||
await initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page2' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page0' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page1' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page2' }));
|
||||
});
|
||||
|
||||
describe('useBlockSuiteWorkspaceHelper', () => {
|
||||
|
||||
@@ -154,7 +154,7 @@ export function useBlockSuiteMetaHelper(
|
||||
const newPage = createPage();
|
||||
const currentPage = blockSuiteWorkspace.getPage(pageId);
|
||||
|
||||
await newPage.waitForLoaded();
|
||||
newPage.waitForLoaded();
|
||||
if (!currentPageMeta || !currentPage) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { DisposableGroup } from '@blocksuite/global/utils';
|
||||
import type { Page, Workspace } from '@blocksuite/store';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const logger = new DebugLogger('use-block-suite-workspace-page');
|
||||
|
||||
export function useBlockSuiteWorkspacePage(
|
||||
blockSuiteWorkspace: Workspace,
|
||||
pageId: string | null
|
||||
@@ -36,9 +33,7 @@ export function useBlockSuiteWorkspacePage(
|
||||
|
||||
useEffect(() => {
|
||||
if (page && !page.loaded) {
|
||||
page.load().catch(err => {
|
||||
logger.error('Failed to load page', err);
|
||||
});
|
||||
page.load();
|
||||
}
|
||||
}, [page]);
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ export const useJournalHelper = (workspace: BlockSuiteWorkspace) => {
|
||||
page.workspace.setPageMeta(page.id, {
|
||||
createDate: dayjs(maybeDate).toDate().getTime(),
|
||||
});
|
||||
initEmptyPage(page, title).catch(err =>
|
||||
console.error('Failed to load journal page', err)
|
||||
);
|
||||
initEmptyPage(page, title);
|
||||
adapter.setJournalPageDateString(page.id, title);
|
||||
return page;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user