1
0
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:
Laurent Cozic 2018-09-30 20:43:46 +01:00
parent 6ea77b36ce
commit 95a06c4531
3 changed files with 7 additions and 5 deletions

View File

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

View File

@ -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({

View File

@ -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