|
13 | 13 | } from '$lib/services/assets'; |
14 | 14 | import { getFolderLabelByCollection } from '$lib/services/assets/view'; |
15 | 15 | import { getCollection, getCollectionIndex } from '$lib/services/contents/collection'; |
16 | | - import { getCollectionFileIndex } from '$lib/services/contents/collection/files'; |
| 16 | + import { |
| 17 | + getCollectionFile, |
| 18 | + getCollectionFileIndex, |
| 19 | + } from '$lib/services/contents/collection/files'; |
17 | 20 | import { isSmallScreen } from '$lib/services/user/env'; |
18 | 21 |
|
19 | 22 | const numberFormatter = $derived(Intl.NumberFormat($appLocale ?? undefined)); |
|
45 | 48 | <OptionGroup label={$_('asset_location.repository')}> |
46 | 49 | {#each folders as folder ([folder.collectionName, folder.fileName, folder.internalPath].join(':'))} |
47 | 50 | {#await sleep() then} |
48 | | - {@const { collectionName, internalPath, entryRelative, hasTemplateTags } = folder} |
| 51 | + {@const { collectionName, fileName, internalPath, entryRelative, hasTemplateTags } = |
| 52 | + folder} |
49 | 53 | {@const collection = collectionName ? getCollection(collectionName) : undefined} |
| 54 | + {@const collectionFile = |
| 55 | + collection && fileName ? getCollectionFile(collection, fileName) : undefined} |
50 | 56 | <!-- Can’t upload assets if collection assets are saved at entry-relative paths --> |
51 | 57 | {@const uploadDisabled = entryRelative || hasTemplateTags} |
52 | 58 | {@const selected = equal($selectedAssetFolder, folder)} |
|
107 | 113 | }} |
108 | 114 | > |
109 | 115 | {#snippet startIcon()} |
110 | | - <Icon name={collection?.icon || 'folder'} /> |
| 116 | + <Icon name={collectionFile?.icon || collection?.icon || 'folder'} /> |
111 | 117 | {/snippet} |
112 | 118 | {#snippet endIcon()} |
113 | 119 | {#key $allAssets} |
|
0 commit comments