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

5
package-lock.json generated
View file

@ -1,12 +1,11 @@
{
"name": "trilium",
"version": "0.61.4-beta",
"version": "0.61.5-beta",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "trilium",
"version": "0.61.4-beta",
"version": "0.61.5-beta",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
"dependencies": {

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);