Не подтверждена Коммит b06aeb22 создал по автору Lye Hongtao's avatar Lye Hongtao Зафиксировано автором GitHub
Просмотр файлов

fix: view in edgeless button of surface block (#6013)



Co-authored-by: default avatardonteatfriedrice <huisheng.chen7788@outlook.com>
Co-authored-by: default avatarChen <99816898+donteatfriedrice@users.noreply.github.com>
владелец ebf7a743
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
EmbedYoutubeService, EmbedYoutubeService,
ImageService, ImageService,
} from '@blocksuite/blocks'; } from '@blocksuite/blocks';
import { DisposableGroup } from '@blocksuite/global/utils';
import type { AffineEditorContainer } from '@blocksuite/presets'; import type { AffineEditorContainer } from '@blocksuite/presets';
import type { Doc as BlockSuiteDoc } from '@blocksuite/store'; import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
import { import {
...@@ -134,6 +135,8 @@ const DetailPageImpl = memo(function DetailPageImpl() { ...@@ -134,6 +135,8 @@ const DetailPageImpl = memo(function DetailPageImpl() {
// 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('affine:page');
const disposable = new DisposableGroup();
pageService.getEditorMode = (pageId: string) => pageService.getEditorMode = (pageId: string) =>
pageRecordList.record(pageId).value?.mode.value ?? 'page'; pageRecordList.record(pageId).value?.mode.value ?? 'page';
pageService.getDocUpdatedAt = (pageId: string) => { pageService.getDocUpdatedAt = (pageId: string) => {
...@@ -147,18 +150,26 @@ const DetailPageImpl = memo(function DetailPageImpl() { ...@@ -147,18 +150,26 @@ 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?
const dispose = editor.slots.docLinkClicked.on(({ docId }) => { disposable.add(
return openPage(blockSuiteWorkspace.id, docId); editor.slots.docLinkClicked.on(({ docId }) => {
}); return openPage(blockSuiteWorkspace.id, docId);
const disposeTagClick = editor.slots.tagClicked.on(({ tagId }) => { })
jumpToTag(currentWorkspace.id, tagId); );
}); disposable.add(
editor.slots.tagClicked.on(({ tagId }) => {
jumpToTag(currentWorkspace.id, tagId);
})
);
disposable.add(
pageService.slots.editorModeSwitch.on(mode => {
page.setMode(mode);
})
);
setEditor(editor); setEditor(editor);
return () => { return () => {
dispose.dispose(); disposable.dispose();
disposeTagClick.dispose();
}; };
}, },
[ [
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать