Skip to content

Commit 3e85ea3

Browse files
committed
fix: fetchConfigBlob directly on load
1 parent 3b88999 commit 3e85ea3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/stores/registry.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ export const useRegistryStore = defineStore('registry', {
272272

273273
this.repositoriesWithTags.set(repositoryName, tagsWithDetails)
274274

275+
// Preload all config details in background
276+
const storedTags = this.repositoriesWithTags.get(repositoryName) || []
277+
storedTags.forEach(tag => {
278+
if (!tag.hasError && tag.manifestDetails?.config.digest) {
279+
this.fetchConfigBlob(repositoryName, tag).catch(error => {
280+
logger.warn(`Failed to preload config for ${repositoryName}:${tag.name}:`, error)
281+
})
282+
}
283+
})
284+
275285
const repo = this.repositories.find(r => r.name === repositoryName)
276286
if (repo) {
277287
repo.tagCount = tagsWithDetails.length
@@ -352,6 +362,11 @@ export const useRegistryStore = defineStore('registry', {
352362
return
353363
}
354364

365+
// Skip if already loaded or currently loading (avoid duplicate API calls)
366+
if (tag.configDetails || tag.isLoadingConfig) {
367+
return
368+
}
369+
355370
tag.isLoadingConfig = true
356371

357372
try {

0 commit comments

Comments
 (0)