i18n interests, allow for fallbacks (#2692)

This commit is contained in:
Eric Bailey
2024-01-30 17:04:54 -06:00
committed by GitHub
parent 4058174678
commit bb7ce215f7
9 changed files with 103 additions and 56 deletions
+9 -1
View File
@@ -31,7 +31,15 @@ export function aggregateInterestItems(
const selected = interests.length
const all = interests
.map(i => {
const suggestions = shuffle(map[i])
// suggestions from server
const rawSuggestions = map[i]
// safeguard against a missing interest->suggestion mapping
if (!rawSuggestions || !rawSuggestions.length) {
return []
}
const suggestions = shuffle(rawSuggestions)
if (selected === 1) {
return suggestions // return all