fix: linked doc jump (#6074)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Scrollable } from '@affine/component';
|
import { Scrollable } from '@affine/component';
|
||||||
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
|
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
|
||||||
import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||||
|
import type { PageRootService } from '@blocksuite/blocks';
|
||||||
import {
|
import {
|
||||||
BookmarkService,
|
BookmarkService,
|
||||||
customImageProxyMiddleware,
|
customImageProxyMiddleware,
|
||||||
@@ -136,7 +137,8 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
|||||||
EmbedLoomService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
EmbedLoomService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);
|
||||||
|
|
||||||
// provide page mode and updated date to blocksuite
|
// provide page mode and updated date to blocksuite
|
||||||
const pageService = editorHost.std.spec.getService('affine:page');
|
const pageService =
|
||||||
|
editorHost.std.spec.getService<PageRootService>('affine:page');
|
||||||
const disposable = new DisposableGroup();
|
const disposable = new DisposableGroup();
|
||||||
|
|
||||||
pageService.getEditorMode = (pageId: string) =>
|
pageService.getEditorMode = (pageId: string) =>
|
||||||
@@ -153,12 +155,12 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
|||||||
page.setMode(mode);
|
page.setMode(mode);
|
||||||
// fixme: it seems pageLinkClicked is not triggered sometimes?
|
// fixme: it seems pageLinkClicked is not triggered sometimes?
|
||||||
disposable.add(
|
disposable.add(
|
||||||
editor.slots.docLinkClicked.on(({ docId }) => {
|
pageService.slots.docLinkClicked.on(({ docId }) => {
|
||||||
return openPage(blockSuiteWorkspace.id, docId);
|
return openPage(blockSuiteWorkspace.id, docId);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
disposable.add(
|
disposable.add(
|
||||||
editor.slots.tagClicked.on(({ tagId }) => {
|
pageService.slots.tagClicked.on(({ tagId }) => {
|
||||||
jumpToTag(currentWorkspace.id, tagId);
|
jumpToTag(currentWorkspace.id, tagId);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user