0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-11 01:18:24 -05:00

fix(web): sort folders (#15691)

fixes #13145
This commit is contained in:
Carsten Otto 2025-01-26 22:07:22 +01:00 committed by GitHub
parent 72a55c13b6
commit e864811a85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 3 additions and 4 deletions

View file

@ -15,7 +15,7 @@
</script> </script>
<ul class="list-none ml-2"> <ul class="list-none ml-2">
{#each Object.entries(items) as [path, tree]} {#each Object.entries(items).sort() as [path, tree]}
{@const value = normalizeTreePath(`${parent}/${path}`)} {@const value = normalizeTreePath(`${parent}/${path}`)}
{@const key = value + getColor(value)} {@const key = value + getColor(value)}
{#key key} {#key key}

View file

@ -24,7 +24,6 @@ class FoldersStore {
const uniquePaths = await getUniqueOriginalPaths(); const uniquePaths = await getUniqueOriginalPaths();
this.uniquePaths.push(...uniquePaths); this.uniquePaths.push(...uniquePaths);
this.uniquePaths.sort();
} }
bustAssetCache() { bustAssetCache() {

View file

@ -44,7 +44,7 @@
let pathSegments = $derived(data.path ? data.path.split('/') : []); let pathSegments = $derived(data.path ? data.path.split('/') : []);
let tree = $derived(buildTree(foldersStore.uniquePaths)); let tree = $derived(buildTree(foldersStore.uniquePaths));
let currentPath = $derived($page.url.searchParams.get(QueryParameter.PATH) || ''); let currentPath = $derived($page.url.searchParams.get(QueryParameter.PATH) || '');
let currentTreeItems = $derived(currentPath ? data.currentFolders : Object.keys(tree)); let currentTreeItems = $derived(currentPath ? data.currentFolders : Object.keys(tree).sort());
const assetInteraction = new AssetInteraction(); const assetInteraction = new AssetInteraction();

View file

@ -34,7 +34,7 @@ export const load = (async ({ params, url }) => {
return { return {
asset, asset,
path, path,
currentFolders: Object.keys(tree || {}), currentFolders: Object.keys(tree || {}).sort(),
pathAssets, pathAssets,
meta: { meta: {
title: $t('folders'), title: $t('folders'),