1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-21 23:17:42 +02:00

Desktop: Resolves #206: Added support for sorting notebooks by title or last modified

This commit is contained in:
Laurent Cozic
2019-03-02 17:35:57 +00:00
parent 2256b0c5ec
commit 833d473268
8 changed files with 204 additions and 25 deletions

View File

@ -299,6 +299,7 @@ class BaseApplication {
const result = next(action);
const newState = store.getState();
let refreshNotes = false;
let refreshFolders = false;
// let refreshTags = false;
let refreshNotesUseSelectedNoteId = false;
@ -389,10 +390,11 @@ class BaseApplication {
}
if (action.type === 'NOTE_UPDATE_ONE') {
// If there is a conflict, we refresh the folders so as to display "Conflicts" folder
if (action.note && action.note.is_conflict) {
await FoldersScreenUtils.refreshFolders();
}
refreshFolders = true;
}
if (this.hasGui() && ((action.type == 'SETTING_UPDATE_ONE' && action.key.indexOf('folders.sortOrder') === 0) || action.type == 'SETTING_UPDATE_ALL')) {
refreshFolders = 'now';
}
if (this.hasGui() && action.type == 'SETTING_UPDATE_ONE' && action.key == 'sync.interval' || action.type == 'SETTING_UPDATE_ALL') {
@ -407,6 +409,14 @@ class BaseApplication {
ResourceFetcher.instance().queueDownload(action.id);
}
if (refreshFolders) {
if (refreshFolders === 'now') {
await FoldersScreenUtils.refreshFolders();
} else {
await FoldersScreenUtils.scheduleRefreshFolders();
}
}
return result;
}