refactor: remove unused code (#2484)

This commit is contained in:
Himself65
2023-05-22 17:11:18 +08:00
committed by GitHub
parent 281a068cfb
commit f01997f8ee
31 changed files with 44 additions and 1505 deletions

View File

@@ -21,7 +21,7 @@ export type EditorProps = {
page: Page;
mode: 'page' | 'edgeless';
onInit: (page: Page, editor: Readonly<EditorContainer>) => void;
onLoad?: (page: Page, editor: EditorContainer) => void;
onLoad?: (page: Page, editor: EditorContainer) => () => void;
style?: CSSProperties;
};
@@ -67,7 +67,7 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
if (page.root === null) {
props.onInit(page, editor);
}
props.onLoad?.(page, editor);
return props.onLoad?.(page, editor);
}
}, [props.page, props.onInit, props.onLoad, editor, props, page]);

View File

@@ -103,9 +103,6 @@ export const toast = (
easing: 'cubic-bezier(0.21, 1.02, 0.73, 1)',
fill: 'forwards' as const,
}; // satisfies KeyframeAnimationOptions;
// FIXME: Vitest not support element.animate,
// can try it in `apps/web/src/components/__tests__/PinBoard.spec.tsx` `delete pivot`
typeof element.animate === 'function' && element.animate(fadeIn, options);
setTimeout(async () => {
if (typeof element.animate !== 'function') return;