feat(nbstore): add indexer storage (#10953)

This commit is contained in:
EYHN
2025-03-31 12:59:51 +00:00
parent c9e14ac0db
commit 8957d0645f
82 changed files with 3393 additions and 4753 deletions
@@ -1,6 +1,6 @@
import { DocsSearchService } from '@affine/core/modules/docs-search';
import { LiveData, useLiveData, useService } from '@toeverything/infra';
import { type ReactNode, useMemo } from 'react';
import { type ReactNode, useEffect, useMemo } from 'react';
interface PagePreviewProps {
pageId: string;
@@ -21,6 +21,11 @@ const PagePreviewInner = ({
)
);
useEffect(() => {
const undo = docSummary.indexer.addPriority(pageId, 100);
return undo;
}, [docSummary, pageId]);
const res =
summary === null ? fallback : summary === '' ? emptyFallback : summary;
return res;