File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,9 +104,16 @@ export const AppHostedLanguageGroup: React.FunctionComponent = () => {
104104 getItemProps : ( options : GetItemPropsOptions < any > ) => { } ,
105105 getMenuProps : ( options : GetMenuPropsOptions ) => { }
106106 ) => {
107- languagesToDisplay = getLanguagesMatchingSearchTerm ( searchTerm ) . filter (
108- ( lang ) => preferredLangCodes . indexOf ( lang . isoCode ) < 0
109- ) ;
107+ const matchingLanguages = getLanguagesMatchingSearchTerm ( searchTerm ) ;
108+ languagesToDisplay = matchingLanguages ;
109+ if ( showPreferredLangs ) {
110+ // Filter out favorites from the main list so we don't show the same language twice.
111+ // Note: it is important not to do this when favorites are hidden; else they won't show at all. BL-15822
112+ languagesToDisplay = matchingLanguages . filter (
113+ ( lang ) => ! preferredLangCodes . includes ( lang . isoCode )
114+ ) ;
115+ }
116+
110117 const prefColor = commonUI . colors . bloomRed ;
111118 // if (!showAll && languagesToDisplay.length > 10) {
112119 // languagesToDisplay.splice(10);
You can’t perform that action at this time.
0 commit comments