small refactor

This commit is contained in:
zadam
2023-08-17 09:09:06 +02:00
parent 515c5411a6
commit c1865f8564
2 changed files with 4 additions and 7 deletions

View File

@@ -184,10 +184,8 @@ function sortNotesIfNeeded(parentNoteId) {
}
const sortReversed = parentNote.getLabelValue('sortDirection')?.toLowerCase() === "desc";
const sortFoldersFirstLabel = parentNote.getLabel('sortFoldersFirst');
const sortFoldersFirst = sortFoldersFirstLabel && sortFoldersFirstLabel.value.toLowerCase() !== "false";
const sortNaturalLabel = parentNote.getLabel('sortNatural');
const sortNatural = sortNaturalLabel && sortNaturalLabel.value.toLowerCase() !== "false";
const sortFoldersFirst = parentNote.isLabelTruthy('sortFoldersFirst');
const sortNatural = parentNote.isLabelTruthy('sortNatural');
const sortLocale = parentNote.getLabelValue('sortLocale');
sortNotes(parentNoteId, sortedLabel.value, sortReversed, sortFoldersFirst, sortNatural, sortLocale);