fix: dispose on editor props.onInit (#2521)

This commit is contained in:
Himself65
2023-05-25 14:11:41 +08:00
committed by himself65
parent ad4737850d
commit 3d423c3299
2 changed files with 17 additions and 11 deletions

View File

@@ -311,7 +311,7 @@ export const AffinePlugin: WorkspaceAdapter<WorkspaceFlavour.AFFINE> = {
</Suspense>
);
},
PageDetail: ({ currentWorkspace, currentPageId }) => {
PageDetail: ({ currentWorkspace, currentPageId, onLoadEditor }) => {
const page = currentWorkspace.blockSuiteWorkspace.getPage(currentPageId);
if (!page) {
throw new PageNotFoundError(
@@ -325,6 +325,7 @@ export const AffinePlugin: WorkspaceAdapter<WorkspaceFlavour.AFFINE> = {
pageId={currentPageId}
workspace={currentWorkspace}
onInit={initPage}
onLoad={onLoadEditor}
/>
</>
);