mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
All: Fixes #818: Use sort options when displayed tagged notes
This commit is contained in:
parent
6ea77b36ce
commit
95a06c4531
@ -215,7 +215,7 @@ class BaseApplication {
|
||||
if (parentType === Folder.modelType()) {
|
||||
notes = await Note.previews(parentId, options);
|
||||
} else if (parentType === Tag.modelType()) {
|
||||
notes = await Tag.notes(parentId);
|
||||
notes = await Tag.notes(parentId, options);
|
||||
} else if (parentType === BaseModel.TYPE_SEARCH) {
|
||||
let fields = Note.previewFields();
|
||||
let search = BaseModel.byId(state.searches, parentId);
|
||||
|
@ -114,7 +114,7 @@ class NotesScreenComponent extends BaseScreenComponent {
|
||||
if (props.notesParentType == 'Folder') {
|
||||
notes = await Note.previews(props.selectedFolderId, options);
|
||||
} 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({
|
||||
|
@ -30,13 +30,15 @@ class Tag extends BaseItem {
|
||||
return output;
|
||||
}
|
||||
|
||||
static async notes(tagId) {
|
||||
static async notes(tagId, options = null) {
|
||||
if (options === null) options = {};
|
||||
|
||||
let noteIds = await this.noteIds(tagId);
|
||||
if (!noteIds.length) return [];
|
||||
|
||||
return Note.search({
|
||||
return Note.search(Object.assign({}, options, {
|
||||
conditions: ['id IN ("' + noteIds.join('","') + '")'],
|
||||
});
|
||||
}))
|
||||
}
|
||||
|
||||
// Untag all the notes and delete tag
|
||||
|
Loading…
Reference in New Issue
Block a user