aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/views/favorites.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/views/favorites.ts')
-rw-r--r--apps/files/src/views/favorites.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files/src/views/favorites.ts b/apps/files/src/views/favorites.ts
index cadc7704e14..45cd96510a2 100644
--- a/apps/files/src/views/favorites.ts
+++ b/apps/files/src/views/favorites.ts
@@ -4,13 +4,15 @@
*/
import type { Folder, Node } from '@nextcloud/files'
+import { FileType, View, getNavigation } from '@nextcloud/files'
+import { getCanonicalLocale, getLanguage, t } from '@nextcloud/l10n'
+import { getFavoriteNodes } from '@nextcloud/files/dav'
import { subscribe } from '@nextcloud/event-bus'
-import { FileType, View, getFavoriteNodes, getNavigation } from '@nextcloud/files'
-import { getLanguage, translate as t } from '@nextcloud/l10n'
-import { client } from '../services/WebdavClient.ts'
+
import FolderSvg from '@mdi/svg/svg/folder.svg?raw'
import StarSvg from '@mdi/svg/svg/star.svg?raw'
+import { client } from '../services/WebdavClient.ts'
import { getContents } from '../services/Favorites'
import { hashCode } from '../utils/hashUtils'
import logger from '../logger'
@@ -118,7 +120,7 @@ export const registerFavoritesView = async () => {
* update the order property of the existing views
*/
const updateAndSortViews = function() {
- favoriteFolders.sort((a, b) => a.path.localeCompare(b.path, getLanguage(), { ignorePunctuation: true }))
+ favoriteFolders.sort((a, b) => a.basename.localeCompare(b.basename, [getLanguage(), getCanonicalLocale()], { ignorePunctuation: true, numeric: true, usage: 'sort' }))
favoriteFolders.forEach((folder, index) => {
const view = favoriteFoldersViews.find((view) => view.id === generateIdFromPath(folder.path))
if (view) {
@@ -176,4 +178,6 @@ export const registerFavoritesView = async () => {
removePathFromFavorites(favoriteFolder.path)
addToFavorites(node)
}
+
+ updateAndSortViews()
}