@selfcommunity/react-ui 0.7.36 → 0.7.37-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,9 +109,9 @@ function SearchAutocomplete(inProps) {
109
109
  const optionLabel = (option) => {
110
110
  switch (option.type) {
111
111
  case types_1.SuggestionType.CATEGORY:
112
- return option[option.type]['name_synonyms'];
112
+ return option[option.type]['name_synonyms'] || option[option.type]['name'];
113
113
  case types_1.SuggestionType.USER:
114
- return option[option.type]['username'];
114
+ return option[option.type]['username'] && option[option.type]['real_name'];
115
115
  default:
116
116
  return option[option.type]['name'];
117
117
  }
@@ -107,9 +107,9 @@ export default function SearchAutocomplete(inProps) {
107
107
  const optionLabel = (option) => {
108
108
  switch (option.type) {
109
109
  case SuggestionType.CATEGORY:
110
- return option[option.type]['name_synonyms'];
110
+ return option[option.type]['name_synonyms'] || option[option.type]['name'];
111
111
  case SuggestionType.USER:
112
- return option[option.type]['username'];
112
+ return option[option.type]['username'] && option[option.type]['real_name'];
113
113
  default:
114
114
  return option[option.type]['name'];
115
115
  }