Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix archived notes not showing in attachment's linked notes (#9001)

01zulfib7b474b24590
diff --git a/packages/core/src/collections/relations.ts b/packages/core/src/collections/relations.ts
index cd9acf7c2..076a68275 100644
--- a/packages/core/src/collections/relations.ts
+++ b/packages/core/src/collections/relations.ts
@@ -397,7 +397,8 @@ class RelationsArray<TType extends keyof RelatableTable> {
)
.$if(
!!this.types?.includes("note" as TType) &&
- this.db.notes.cache.archived.length > 0,
+ this.db.notes.cache.archived.length > 0 &&
+ this.reference.type !== "attachment",
(b) => b.where("fromId", "not in", this.db.notes.cache.archived)
)
.$if(