Skip to content

Commit

Permalink
Merge pull request #1576 from Zhephyr54/fix-ModernTaxonomyPicker-lang
Browse files Browse the repository at this point in the history
Fix ModernTaxonomyPicker used language by checking for supported term…
  • Loading branch information
joelfmrodrigues committed Jul 6, 2023
2 parents bb65540 + c0d2f53 commit 80c468d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controls/modernTaxonomyPicker/ModernTaxonomyPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export function ModernTaxonomyPicker(props: IModernTaxonomyPickerProps): JSX.Ele
taxonomyService.getTermStoreInfo()
.then((termStoreInfo) => {
setCurrentTermStoreInfo(termStoreInfo);
const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' ?
const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' && termStoreInfo.languageTags.includes(props.context.pageContext.cultureInfo.currentUICultureName) ?
props.context.pageContext.cultureInfo.currentUICultureName :
currentTermStoreInfo.defaultLanguageTag;
termStoreInfo.defaultLanguageTag;
setCurrentLanguageTag(languageTag);
setSelectedOptions(Array.isArray(props.initialValues) ?
props.initialValues.map(term => { return { ...term, languageTag: languageTag, termStoreInfo: termStoreInfo } as ITermInfo; }) :
Expand Down

0 comments on commit 80c468d

Please sign in to comment.