mirror of https://github.com/nextcloud/bookmarks
parent
c130cff7d1
commit
6ff0d710e6
|
@ -36,7 +36,7 @@ export default {
|
|||
Vue.set(state.settings, key, value)
|
||||
},
|
||||
[mutations.SET_FOLDERS](state, folders) {
|
||||
state.folders = folders
|
||||
state.folders = sortFolders(folders)
|
||||
},
|
||||
[mutations.SET_TAGS](state, tags) {
|
||||
state.tags = tags
|
||||
|
@ -125,3 +125,10 @@ export default {
|
|||
Vue.set(state.fetchState, 'reachedEnd', true)
|
||||
}
|
||||
}
|
||||
|
||||
function sortFolders(folders) {
|
||||
folders.forEach(folder => {
|
||||
folder.children = sortFolders(folder.children)
|
||||
})
|
||||
return folders.sort((a, b) => a.title > b.title ? 1 : -1)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue