mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor(editor): remove assert functions (#10629)
This commit is contained in:
@@ -11,7 +11,6 @@ import { DebugLogger } from '@affine/debug';
|
||||
import type { ListHistoryQuery } from '@affine/graphql';
|
||||
import { listHistoryQuery, recoverDocMutation } from '@affine/graphql';
|
||||
import { i18nTime } from '@affine/i18n';
|
||||
import { assertEquals } from '@blocksuite/affine/global/utils';
|
||||
import type { Workspace } from '@blocksuite/affine/store';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
@@ -291,7 +290,9 @@ export const useRestorePage = (docCollection: Workspace, pageId: string) => {
|
||||
}
|
||||
const pageDocId = page.spaceDoc.guid;
|
||||
revertUpdate(page.spaceDoc, update, key => {
|
||||
assertEquals(key, 'blocks'); // only expect this value is 'blocks'
|
||||
if (key !== 'blocks') {
|
||||
throw new Error('Only expect this value is "blocks"');
|
||||
}
|
||||
return 'Map';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user