Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): trash doc in search result (#7785)

EYHN83244f020163
diff --git a/packages/frontend/core/src/modules/docs-search/entities/docs-indexer.ts b/packages/frontend/core/src/modules/docs-search/entities/docs-indexer.ts
index ccfa246aea..926a8eefb0 100644
--- a/packages/frontend/core/src/modules/docs-search/entities/docs-indexer.ts
+++ b/packages/frontend/core/src/modules/docs-search/entities/docs-indexer.ts
@@ -173,7 +173,7 @@ export class DocsIndexer extends Entity {
}
);
for (const block of oldBlocks.nodes) {
- docIndexWriter.delete(block.id);
+ blockIndexWriter.delete(block.id);
}
}
await blockIndexWriter.commit();
diff --git a/packages/frontend/core/src/modules/quicksearch/impls/recent-docs.ts b/packages/frontend/core/src/modules/quicksearch/impls/recent-docs.ts
index f50459c4d2..6f16e33091 100644
--- a/packages/frontend/core/src/modules/quicksearch/impls/recent-docs.ts
+++ b/packages/frontend/core/src/modules/quicksearch/impls/recent-docs.ts
@@ -37,8 +37,9 @@ export class RecentDocsQuickSearchSession
const docRecords = this.recentDocsService.getRecentDocs();
- return docRecords.map<QuickSearchItem<'recent-doc', { docId: string }>>(
- docRecord => {
+ return docRecords
+ .filter(doc => !get(doc.trash$))
+ .map<QuickSearchItem<'recent-doc', { docId: string }>>(docRecord => {
const { title, icon } =
this.docDisplayMetaService.getDocDisplayMeta(docRecord);
@@ -54,8 +55,7 @@ export class RecentDocsQuickSearchSession
timestamp: docRecord.meta$.value.updatedDate,
payload: { docId: docRecord.id },
};
- }
- );
+ });
});
query(query: string) {