refactor(editor): remove legacy blocksuite doc (#9521)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { Blocks } from '@blocksuite/affine/store';
|
||||
import type { Map as YMap } from 'yjs';
|
||||
import type { Doc as YDoc, Map as YMap } from 'yjs';
|
||||
|
||||
/**
|
||||
* TODO(@eyhn): Define error to unexpected state together in the future.
|
||||
@@ -9,9 +9,9 @@ export class NoPageRootError extends Error {
|
||||
super('Page root not found when render editor!');
|
||||
|
||||
// Log info to let sentry collect more message
|
||||
const hasExpectSpace = Array.from(page.rootDoc.spaces.values()).some(
|
||||
doc => page.spaceDoc.guid === doc.guid
|
||||
);
|
||||
const hasExpectSpace = Array.from(
|
||||
page.rootDoc.getMap<YDoc>('spaces').values()
|
||||
).some(doc => page.spaceDoc.guid === doc.guid);
|
||||
const blocks = page.spaceDoc.getMap('blocks') as YMap<YMap<any>>;
|
||||
const havePageBlock = Array.from(blocks.values()).some(
|
||||
block => block.get('sys:flavour') === 'affine:page'
|
||||
|
||||
Reference in New Issue
Block a user