mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(infra): collect more data to indexer (#8528)
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { DocLinksService } from '@affine/core/modules/doc-link';
|
||||
import {
|
||||
type Backlink,
|
||||
DocLinksService,
|
||||
type Link,
|
||||
} from '@affine/core/modules/doc-link';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useLiveData, useServices } from '@toeverything/infra';
|
||||
import { LiveData, useLiveData, useServices } from '@toeverything/infra';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { AffinePageReference } from '../../affine/reference-link';
|
||||
@@ -13,8 +17,12 @@ export const BiDirectionalLinkPanel = () => {
|
||||
});
|
||||
const t = useI18n();
|
||||
|
||||
const links = useLiveData(docLinksService.links.links$);
|
||||
const backlinks = useLiveData(docLinksService.backlinks.backlinks$);
|
||||
const links = useLiveData(
|
||||
show ? docLinksService.links.links$ : new LiveData([] as Link[])
|
||||
);
|
||||
const backlinks = useLiveData(
|
||||
show ? docLinksService.backlinks.backlinks$ : new LiveData([] as Backlink[])
|
||||
);
|
||||
const handleClickShow = useCallback(() => {
|
||||
setShow(!show);
|
||||
}, [show]);
|
||||
|
||||
@@ -103,7 +103,10 @@ export const DocPropertiesTableHeader = ({
|
||||
EditorSettingService,
|
||||
});
|
||||
const docBacklinks = docLinksService.backlinks;
|
||||
const backlinks = useLiveData(docBacklinks.backlinks$);
|
||||
const backlinks = useMemo(
|
||||
() => docBacklinks.backlinks$.value,
|
||||
[docBacklinks]
|
||||
);
|
||||
|
||||
const displayDocInfo = useLiveData(
|
||||
editorSettingService.editorSetting.settings$.selector(s => s.displayDocInfo)
|
||||
|
||||
Reference in New Issue
Block a user