You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-12 22:57:38 +02:00
Clipper: Fixes #1417: Sort the folders in the same order as the desktop app
This commit is contained in:
@ -3,22 +3,29 @@ const Setting = require('lib/models/Setting.js');
|
||||
|
||||
class FoldersScreenUtils {
|
||||
|
||||
static async refreshFolders() {
|
||||
static async allForDisplay(options = {}) {
|
||||
const orderDir = Setting.value('folders.sortOrder.reverse') ? 'DESC' : 'ASC';
|
||||
|
||||
let folders = await Folder.all({
|
||||
includeConflictFolder: true,
|
||||
const folderOptions = Object.assign({}, {
|
||||
caseInsensitive: true,
|
||||
order: [{
|
||||
by: 'title',
|
||||
dir: orderDir,
|
||||
}]
|
||||
});
|
||||
}, options);
|
||||
|
||||
let folders = await Folder.all(folderOptions);
|
||||
|
||||
if (Setting.value('folders.sortOrder.field') === 'last_note_user_updated_time') {
|
||||
folders = await Folder.orderByLastModified(folders, orderDir);
|
||||
}
|
||||
|
||||
return folders;
|
||||
}
|
||||
|
||||
static async refreshFolders() {
|
||||
const folders = await this.allForDisplay({ includeConflictFolder: true });
|
||||
|
||||
this.dispatch({
|
||||
type: 'FOLDER_UPDATE_ALL',
|
||||
items: folders,
|
||||
|
Reference in New Issue
Block a user