mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 18:39:01 +01:00
feat(collections/list): filter archived notes
This commit is contained in:
parent
b13c0fe7a2
commit
e51daad5da
@ -255,6 +255,15 @@ export default class FNote {
|
|||||||
return this.children;
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getChildNoteIdsWithArchiveFiltering(includeArchived = false) {
|
||||||
|
let noteIds: string[] = [];
|
||||||
|
for (const child of await this.getChildNotes()) {
|
||||||
|
if (child.isArchived && !includeArchived) continue;
|
||||||
|
noteIds.push(child.noteId);
|
||||||
|
}
|
||||||
|
return noteIds;
|
||||||
|
}
|
||||||
|
|
||||||
async getSubtreeNoteIds(includeArchived = false) {
|
async getSubtreeNoteIds(includeArchived = false) {
|
||||||
let noteIds: (string | string[])[] = [];
|
let noteIds: (string | string[])[] = [];
|
||||||
for (const child of await this.getChildNotes()) {
|
for (const child of await this.getChildNotes()) {
|
||||||
|
|||||||
@ -141,7 +141,7 @@ export function useNoteIds(note: FNote | null | undefined, viewType: ViewTypeOpt
|
|||||||
|
|
||||||
async function getNoteIds(note: FNote) {
|
async function getNoteIds(note: FNote) {
|
||||||
if (viewType === "list" || viewType === "grid" || viewType === "table" || note.type === "search") {
|
if (viewType === "list" || viewType === "grid" || viewType === "table" || note.type === "search") {
|
||||||
return note.getChildNoteIds();
|
return await note.getChildNoteIdsWithArchiveFiltering(includeArchived);
|
||||||
} else {
|
} else {
|
||||||
return await note.getSubtreeNoteIds(includeArchived);
|
return await note.getSubtreeNoteIds(includeArchived);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user