You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-13 22:12:50 +02:00
All: Fixes #818: Use sort options when displayed tagged notes
This commit is contained in:
@@ -215,7 +215,7 @@ class BaseApplication {
|
|||||||
if (parentType === Folder.modelType()) {
|
if (parentType === Folder.modelType()) {
|
||||||
notes = await Note.previews(parentId, options);
|
notes = await Note.previews(parentId, options);
|
||||||
} else if (parentType === Tag.modelType()) {
|
} else if (parentType === Tag.modelType()) {
|
||||||
notes = await Tag.notes(parentId);
|
notes = await Tag.notes(parentId, options);
|
||||||
} else if (parentType === BaseModel.TYPE_SEARCH) {
|
} else if (parentType === BaseModel.TYPE_SEARCH) {
|
||||||
let fields = Note.previewFields();
|
let fields = Note.previewFields();
|
||||||
let search = BaseModel.byId(state.searches, parentId);
|
let search = BaseModel.byId(state.searches, parentId);
|
||||||
|
@@ -114,7 +114,7 @@ class NotesScreenComponent extends BaseScreenComponent {
|
|||||||
if (props.notesParentType == 'Folder') {
|
if (props.notesParentType == 'Folder') {
|
||||||
notes = await Note.previews(props.selectedFolderId, options);
|
notes = await Note.previews(props.selectedFolderId, options);
|
||||||
} else {
|
} else {
|
||||||
notes = await Tag.notes(props.selectedTagId); // TODO: should also return previews
|
notes = await Tag.notes(props.selectedTagId, options); // TODO: should also return previews
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
|
@@ -30,13 +30,15 @@ class Tag extends BaseItem {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async notes(tagId) {
|
static async notes(tagId, options = null) {
|
||||||
|
if (options === null) options = {};
|
||||||
|
|
||||||
let noteIds = await this.noteIds(tagId);
|
let noteIds = await this.noteIds(tagId);
|
||||||
if (!noteIds.length) return [];
|
if (!noteIds.length) return [];
|
||||||
|
|
||||||
return Note.search({
|
return Note.search(Object.assign({}, options, {
|
||||||
conditions: ['id IN ("' + noteIds.join('","') + '")'],
|
conditions: ['id IN ("' + noteIds.join('","') + '")'],
|
||||||
});
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Untag all the notes and delete tag
|
// Untag all the notes and delete tag
|
||||||
|
Reference in New Issue
Block a user