refactor(editor): remove assert functions (#10629)

This commit is contained in:
Saul-Mirone
2025-03-05 10:20:02 +00:00
parent 201c3438ba
commit 7e39893aac
17 changed files with 63 additions and 95 deletions

View File

@@ -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';
});