File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,10 @@ export const useBootcamp = () => {
215
215
} ) ;
216
216
217
217
const filterAssets = ( assets , isFeatured ) => assets . filter ( ( asset ) => {
218
- const assetSlug = asset ?. translations ?. [ language ] ?. slug || asset ?. slug ;
218
+ const hasTranslation = asset ?. translations && asset ?. translations [ language ] ;
219
+ if ( ! hasTranslation ) return false ;
220
+
221
+ const assetSlug = asset ?. translations [ language ] ?. slug ;
219
222
return isFeatured ? featuredAssetSlugs . includes ( assetSlug ) : ! featuredAssetSlugs . includes ( assetSlug ) ;
220
223
} ) ;
221
224
@@ -235,7 +238,7 @@ export const useBootcamp = () => {
235
238
}
236
239
237
240
const assignmentsFetch = await Promise . all (
238
- combinedFeaturedAssets . map ( ( item ) => bc . get ( `${ BREATHECODE_HOST } /v1/registry/asset/${ item ?. translations ?. [ language ] ?. slug || item ?. slug } ` )
241
+ combinedFeaturedAssets . map ( ( item ) => bc . get ( `${ BREATHECODE_HOST } /v1/registry/asset/${ item ?. translations ?. [ language ] ?. slug } ` )
239
242
. then ( ( assignmentResp ) => assignmentResp . json ( ) )
240
243
. catch ( ( ) => [ ] ) ) ,
241
244
) ;
You can’t perform that action at this time.
0 commit comments