File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
apps/nextjs-website/src/helpers Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable functional/no-let */
22/* eslint-disable functional/no-expression-statements */
33import { s3DocsPath , staticContentsUrl } from '@/config' ;
4+ import { cons } from 'fp-ts/lib/ReadonlyNonEmptyArray' ;
45import * as path from 'node:path' ;
56
67export interface JsonMetadata {
@@ -224,16 +225,16 @@ async function fetchMetadataWithCache<T extends { readonly dirName: string }>(
224225) : Promise < MetadataCacheItem < T > > {
225226 const now = Date . now ( ) ;
226227 const cacheResult = metadataCache . find ( ( item ) => {
227- const categoryMatch =
228- item . category === metadataCategory && item . locale === locale ;
228+ const categoryMatch = item . category === metadataCategory ;
229+ const localeMatch = item . locale === locale ;
229230 const timeMatch = item . data && now - item . refreshTime < METADATA_CACHE_TTL ;
230231 const dirNameMatch =
231232 ! dirName ||
232233 ( Array . isArray ( item . data ) &&
233234 item . data . length > 0 &&
234235 'dirName' in item . data [ 0 ] &&
235236 item . data . some ( ( m : Record < string , unknown > ) => m . dirName === dirName ) ) ;
236- return categoryMatch && timeMatch && dirNameMatch ;
237+ return categoryMatch && localeMatch && timeMatch && dirNameMatch ;
237238 } ) as MetadataCacheItem < T > | undefined ;
238239
239240 if ( cacheResult ) {
You can’t perform that action at this time.
0 commit comments