diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2025-07-16 09:08:28 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2025-07-17 12:27:53 +0000 |
commit | 2c304b5f6a44f9341ab97e195c0887ed42c9b45f (patch) | |
tree | 6d3a767b62afc761830c16d9fc244ea1194d1c1b | |
parent | 2cbfdcc4932857cc9f335aab86b37cc31cfa863a (diff) | |
download | nextcloud-server-2c304b5f6a44f9341ab97e195c0887ed42c9b45f.tar.gz nextcloud-server-2c304b5f6a44f9341ab97e195c0887ed42c9b45f.zip |
fix(files): sort favorites navigation alphabetically
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r-- | apps/files/src/views/favorites.ts | 12 |
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() } |