From edd1d353bcfe0dd1c2e1c68b6e78e9413bcb71a1 Mon Sep 17 00:00:00 2001 From: cade Date: Wed, 20 May 2026 11:58:55 +0800 Subject: [PATCH] Added icon refresh to not-modified state --- src/r2mm/ecosystem/EcosystemSchema.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/r2mm/ecosystem/EcosystemSchema.ts b/src/r2mm/ecosystem/EcosystemSchema.ts index eb21054f8..979f934a7 100644 --- a/src/r2mm/ecosystem/EcosystemSchema.ts +++ b/src/r2mm/ecosystem/EcosystemSchema.ts @@ -171,8 +171,18 @@ export async function updateLatestEcosystemSchema(): Promise { const currentSchema = await loadSavedEcosystemSchema(); const result = await fetchLatestSchema(currentSchema); + const updateIcons = async (mergedSchema: ThunderstoreEcosystem): Promise => { + const nonBundledIconUrls = getNonBundledIconUrls(mergedSchema, bundledSchema); + if (nonBundledIconUrls.length > 0) { + void GameImageProvider.prefetchAll(nonBundledIconUrls); + } + } + if (result.kind === "not-modified") { - return updateEcosystemReactives(); + const mergedSchema = await resolveCachedEcosystemSchema(); + await updateIcons(mergedSchema); + await internalUpdateEcosystemReactives(mergedSchema); + return; } if (result.kind === "failed") { @@ -186,10 +196,7 @@ export async function updateLatestEcosystemSchema(): Promise { const mergedSchema = mergeSchemas(bundledSchema, result.schema); await writeLatestEcosystemSchema(mergedSchema, result.lastModified); await internalUpdateEcosystemReactives(mergedSchema); - const nonBundledIconUrls = getNonBundledIconUrls(mergedSchema, bundledSchema); - if (nonBundledIconUrls.length > 0) { - void GameImageProvider.prefetchAll(nonBundledIconUrls); - } + await updateIcons(mergedSchema); } async function writeLatestEcosystemSchema(