Web: People: Fixed displaying not found language in combobox

This commit is contained in:
Alexey Safronov 2020-12-22 11:36:07 +03:00
parent 19d72f2fe8
commit a54a735cfa

View File

@ -86,23 +86,13 @@ const IconButtonWrapper = styled.div`
}
`;
const capitalizeFirstLetter = (string) => {
return string && string.charAt(0).toUpperCase() + string.slice(1);
};
class ProfileInfo extends React.PureComponent {
constructor(props) {
super(props);
this.state = this.mapPropsToState(props);
}
mapPropsToState = (props) => {
const newState = {
this.state = {
profile: props.profile,
};
return newState;
};
}
onGroupClick = (e) => {
const group = e.currentTarget.dataset.id;
@ -196,7 +186,9 @@ class ProfileInfo extends React.PureComponent {
const type = isVisitor ? guestCaption : userCaption;
const language = cultureName || currentCulture || this.props.culture;
const languages = this.getLanguages();
const selectedLanguage = languages.find((item) => item.key === language);
const selectedLanguage =
languages.find((item) => item.key === language) ||
languages.find((item) => item.key === this.props.culture);
const workFromDate = new Date(workFrom).toLocaleDateString(language);
const birthDayDate = new Date(birthday).toLocaleDateString(language);
const formatedSex =