mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 20:41:50 +08:00
chore: bump BlockSuite version (#910)
Co-authored-by: QiShaoXuan <qishaoxuan777@gmail.com> Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
@@ -22,15 +22,26 @@ export const Editor = ({ page, workspace, setEditor }: Props) => {
|
||||
const editorContainer = useRef<HTMLDivElement>(null);
|
||||
// const { currentWorkspace, currentPage, setEditor } = useAppState();
|
||||
useEffect(() => {
|
||||
let blockHubElement: HTMLElement | null = null;
|
||||
const ret = () => {
|
||||
const node = editorContainer.current;
|
||||
while (node?.firstChild) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
|
||||
blockHubElement?.remove();
|
||||
};
|
||||
|
||||
const editor = new EditorContainer();
|
||||
editor.page = page;
|
||||
editor.createBlockHub().then(blockHub => {
|
||||
const toolWrapper = document.querySelector('#toolWrapper');
|
||||
if (!toolWrapper) {
|
||||
throw new Error('Can not find toolWrapper');
|
||||
}
|
||||
blockHubElement = blockHub;
|
||||
toolWrapper.appendChild(blockHub);
|
||||
});
|
||||
editorContainer.current?.appendChild(editor);
|
||||
if (page.isEmpty) {
|
||||
const isFirstPage = workspace?.meta.pageMetas.length === 1;
|
||||
|
||||
Reference in New Issue
Block a user