@@ -78,6 +78,7 @@ import Vue from 'vue'
7878import { useFilesStore } from ' ../store/files.ts'
7979import { usePathsStore } from ' ../store/paths.ts'
8080import { useSelectionStore } from ' ../store/selection.ts'
81+ import { useUserConfigStore } from ' ../store/userconfig.ts'
8182import { useViewConfigStore } from ' ../store/viewConfig.ts'
8283import BreadCrumbs from ' ../components/BreadCrumbs.vue'
8384import FilesListVirtual from ' ../components/FilesListVirtual.vue'
@@ -103,14 +104,16 @@ export default Vue.extend({
103104 ],
104105
105106 setup() {
106- const pathsStore = usePathsStore ()
107107 const filesStore = useFilesStore ()
108+ const pathsStore = usePathsStore ()
108109 const selectionStore = useSelectionStore ()
110+ const userConfigStore = useUserConfigStore ()
109111 const viewConfigStore = useViewConfigStore ()
110112 return {
111113 filesStore ,
112114 pathsStore ,
113115 selectionStore ,
116+ userConfigStore ,
114117 viewConfigStore ,
115118 }
116119 },
@@ -123,6 +126,10 @@ export default Vue.extend({
123126 },
124127
125128 computed: {
129+ userConfig() {
130+ return this .userConfigStore .userConfig
131+ },
132+
126133 /** @return {Navigation} */
127134 currentView() {
128135 return this .$navigation .active
@@ -179,11 +186,13 @@ export default Vue.extend({
179186 return orderBy (
180187 [... (this .currentFolder ?._children || []).map (this .getNode ).filter (file => file )],
181188 [
189+ // Sort favorites first if enabled
190+ ... this .userConfig .sort_favorites_first ? [v => v .attributes ?.favorite !== 1 ] : [],
182191 // Sort folders first if sorting by name
183192 ... this .sortingMode === ' basename' ? [v => v .type !== ' folder' ] : [],
184193 // Use sorting mode
185194 v => v [this .sortingMode ],
186- // Fallback to name
195+ // Finally, fallback to name
187196 v => v .basename ,
188197 ],
189198 this .isAscSorting ? [' asc' , ' asc' , ' asc' ] : [' desc' , ' desc' , ' desc' ],
0 commit comments